This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here is a list of scopes to use in Sublime Text 2 snippets - | |
| ActionScript: source.actionscript.2 | |
| AppleScript: source.applescript | |
| ASP: source.asp | |
| Batch FIle: source.dosbatch | |
| C#: source.cs | |
| C++: source.c++ | |
| Clojure: source.clojure | |
| CoffeeScript: source.coffee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function zPad (n) { | |
| var l = 2; | |
| var z = new Array(l+1).join('0'); | |
| return (z+n).slice(-l); | |
| } | |
| function autoTimeString(s) { | |
| s = '' + s.replace(/^\s+/,'').replace(/\s+$/, ''); | |
| if ( s.length === 10 ) { | |
| s = s + '000'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .mo-tips { | |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| width: 240px; | |
| /*min-height: 100px;*/ | |
| margin-top: -50px; | |
| margin-left: -120px; | |
| background-color: #fff; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // a trick of load .config as JSON ;) | |
| require.extensions['.config'] = require.extensions['.json']; | |
| var gulp = require('gulp'); | |
| var rmdir = require('rmdir'); | |
| var browserify = require('gulp-browserify'); | |
| // var named = require('vinyl-named'); | |
| var uglify = require('gulp-uglify'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <ul id="todo"></ul> | |
| <body> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "webpack-demo", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "build": "webpack", | |
| "dev": "webpack-dev-server --devtool eval --progress --colors --hot --content-base build", | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dgram = require('dgram'); | |
| const serverSocket = dgram.createSocket('udp4'); | |
| const multicastAddress = '224.0.0.50'; | |
| const multicastPort = 4321; | |
| const serverPort = 9898; | |
| var AqaraAccessoryFactory; | |
| function startServer() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <!-- select two pictures, and the top one first --> | |
| <input type="file" name="file" id="file" multiple> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| // 绑定/修改 快捷键 | |
| [ | |
| { "keys": ["super+v"], "command": "chain", | |
| "args": { | |
| "commands": [ | |
| ["paste"], | |
| ["reg_replace", {"replacements": ["mock_to_number", "mock_to_string", "fix_key_argument", "fix_array_type"]}] | |
| ] | |
| }, | |
| "context": [ |