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
{ | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"theme": "Soda Dark 3.sublime-theme", | |
"soda_classic_tabs": true, | |
"font-family" : "Inconsolata", |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var steps = [ | |
function step1(){ | |
console.log('step1'); | |
this(); | |
}, | |
function step2(){ | |
console.log('step2'); | |
this(); |
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 Parent(){ | |
this.value = 'Parent'; | |
} | |
Parent.staticMethod = function(){ | |
console.log( 'staticMethod called on Parent' ); | |
} | |
function Child(){ | |
Parent.call(this); |
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
var EventEmitter = require( 'events' ).EventEmitter; | |
var emitter = new EventEmitter(); | |
// SECTION-NAME | |
//////////////////////////////////////////////////////////////////////////////// | |
function emitterClass(){ | |
EventEmitter.call( this ); | |
} |
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-zA-Z0-9_]+)\s*.*$ |
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 add( x,y ){ | |
return x + y; | |
} | |
function staticAdd( x ){ | |
return function( y ){ | |
return x + y; | |
} | |
} |
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
// Template loading code | |
//////////////////////////////////////////////////////////////////////////////// | |
// Reload the cached files when it changes. | |
function onFileChange( filename, filePath, cb ){ | |
function exec( event ){ | |
if( process.env.NODE_ENV !== 'production' ){ | |
console.error( 'Loading template:'.yellow, filePath.grey ); | |
} |
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 wrap( middleware, trigger ){ | |
return function( req, res, next ){ | |
// The trigger can be a function that gets dynamically evaluated every time | |
// or a static truthy/falsy variable | |
if( typeof trigger === 'function' ? trigger() : trigger ){ | |
middleware( req, res, next ) | |
} | |
else{ | |
next(); | |
} |
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
<snippet> | |
<content><![CDATA[ | |
// ${1:SECTION-NAME} | |
//////////////////////////////////////////////////////////////////////////////// | |
$2 | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>sep</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.python</scope> --> |
NewerOlder