⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains 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
# Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus | |
less2stylus = (string) -> | |
string = string | |
.replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/^(\ *)([^\ \n]+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
.replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through) | |
.replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets | |
.replace(/\;\ *?$/gm, "") # remove semicolons | |
.replace(/@(\w+):(\ *)\ /g, (_, $1, $2) -> # replace @variable: with $variable = | |
"$#{$1}#{$2} = " |
This file contains 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
/* | |
* Less compiler with --watch and --smartpath support | |
* | |
* Based on lessc of less 1.3.0 | |
* | |
* Added options: | |
* | |
* -w, --watch Watch files (include @import files) for changes and re-compile | |
* | |
* -m, --smartpath output css file like this: |
Related: [Why you don't need jQuery as an abstraction][2]
$
itself is a god object. Everything goes on it. The standard plugin / extension architecture that is recommended is to just bolt more methods on $
itself!
Surely this is bad. An example would be how we have both $.load
which is overloaded to do completely different things. If they were on two separate sensibly named objects $Container.load
and $EventTarget.load
. Personally I would deprecate the latter in favour of .on('load'
The animation should be it's own little modular thing, not bolted onto $
. Ajax should be it's own little modular thing, not bolted onto $
This file contains 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
[Theme] | |
[email protected],-2016 | |
; My Computer | |
[CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\DefaultIcon] | |
DefaultValue=%WinDir%explorer.exe,0 | |
; My Documents | |
[CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\DefaultIcon] | |
DefaultValue=%WinDir%SYSTEM32\mydocs.dll,0 |
This file contains 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
var cnNum2ArabNum = function(cn){ | |
var arab, parts, cnChars = '零一二三四五六七八九' | |
if (!cn) { | |
return 0 | |
} | |
if (cn.indexOf('亿') !== -1){ | |
parts = cn.split('亿') | |
return cnNum2ArabNum(parts[0]) * 1e8 + cnNum2ArabNum(parts[1]) |
This file contains 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
/** | |
* Some Web development tools for Notepad++ (NppScripting) | |
* Based on jsbeautifier.js and service of reducisaurus.appspot.com. | |
*/ | |
var format = Editor.addMenu("Webtools"); | |
format.addItem({ | |
text:"JSBeautify\tCtrl+Shift+F", | |
cmd:function(){do_js_beautify();} | |
}); |
This file contains 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
var stackSize = 0; | |
function foo(a, stackSize){ | |
stackSize ++; | |
bar(); | |
if (!a.length) return; | |
if (stackSize > 1000) { |
This file contains 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
//缩进两个空格 | |
var a = 1 | |
, b = 2 | |
, c = 3 | |
, d = { | |
e: 4 | |
, f: 5 | |
, g: 6 | |
} | |
, h = [ |
OlderNewer