Skip to content

Instantly share code, notes, and snippets.

View dkwingsmt's full-sized avatar

Tong Mu dkwingsmt

View GitHub Profile
@dkwingsmt
dkwingsmt / shortcut-priority.dart
Last active June 8, 2022 22:36
Shortcut priority
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
class MyIntent extends Intent {
const MyIntent(this.content);
final String content;
}
class MyApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@dkwingsmt
dkwingsmt / main.m
Last active September 19, 2019 14:49
Random ducks
round=1;suc=1;
while true
if randomDucks()
suc=suc+1;
end
round=round+1;
sprintf('%f (%d/%d)', suc/round, suc, round)
end
@dkwingsmt
dkwingsmt / vim-cheatsheet
Last active September 23, 2018 20:46
My Vim cheatcheet
移动光标类:
w 到下个词开始
e 到本词最后(相当于whh,很多时候用这个而不是w)
b 到本词开始/到上个词开始
{ 和 } 向前/向后一个空行
% 匹配括号
gg 文件头
G 文件尾
0 行头(第一列)
^ 行头(第一个非空字符)
@dkwingsmt
dkwingsmt / App.js
Last active May 2, 2018 21:23
Mounting test
import React, { Component } from 'react';
class MountingTest extends Component {
componentDidMount() {
console.warn('mount', this.props.name);
}
componentWillUnmount() {
console.warn('unmount', this.props.name);
}
@dkwingsmt
dkwingsmt / App.js
Last active April 26, 2018 00:03
New react context penetrating shouldComponentUpdate?
import React, { Component, createContext } from 'react';
const ApplicationContext = createContext();
const { Provider, Consumer } = ApplicationContext;
class Display extends Component {
render() {
console.warn('Display render')
return (
@dkwingsmt
dkwingsmt / README.md
Last active August 15, 2017 00:54
File loader error

Install

npm i

Run

./node_modules/.bin/webpack index.js
ls -l ./webpack.png ./build/webpack.png
@dkwingsmt
dkwingsmt / .babelrc
Last active August 11, 2017 23:24
"Module not found" when using named re-exporting from an alias
{
"presets": [
["es2015", {
"modules": false
}],
"stage-0"
],
"plugins": [
["module-resolver", {
"alias": {
{
"presets": [
"es2015",
"stage-0"
]
}
[size=150%][b]Heroes of the Storm PTR Notes — 2017年5月20日[/b][/size]
Blizzard Entertainment 5/8/2017 0
[img]//bnetcmsus-a.akamaihd.net/cms/blog_header/s9/S905U982A5MG1441231839760.jpg[/img]
[size=130%][b]Heroes of the Storm PTR Notes — 2017年5月20日[/b][/size]
Our next Heroes of the Storm patch has just arrived to the Public Test Realm and will be available for playtesting until May 15. During this time, we kindly request your assistance in trying out some of the new content it contains before we officially release the patch to the live version of Heroes. If you encounter any bugs or other issues during your PTR play sessions, please stop by thePTR Bug Report forumto let us know about your experiences.
[img]https://bnetcmsus-a.akamaihd.net/cms/content_folder_media/19RBT3IUQUYB1403137112368.png[/img] [size=130%][b]Jump to Section: [/b][/size]
[img]https://bnetcmsus-a.akamaihd.net/cms/content_folder_media/KZL2FQ5Y3I9C1493853825957.jpg[/img]
[list][*]新英雄
[*]美术
[*]Collection