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 urlLib = require('url'); | |
function UrlAdapter(urlString) { | |
this.urlObj = urlLib.parse(urlString, true); | |
// XXX remove the search property to force format() to use the query object when transforming the url object to a string | |
delete this.urlObj.search; | |
} | |
exports.UrlAdapter = UrlAdapter; |
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
// Empty an Array http://davidwalsh.name/empty-array | |
myArray = []; // bad | |
myArray.length = 0; // good! | |
//http://www.w3schools.com/js/js_performance.asp | |
//bad | |
for (i = 0; i < arr.length; i++) {} | |
//good | |
var l = arr.length; |
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 isNullOrWhitespace( input ) { | |
if (typeof input === 'undefined' || input == null) return true; | |
return input.replace(/\s/g, '').length < 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
#install/reinstall/update | |
curl https://install.meteor.com/ | sh | |
#Version Check | |
meteor --version |
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
//http://stackoverflow.com/questions/14245769/check-all-checkboxes-in-page-via-developer-tools | |
//run this in developer console. | |
(function() { | |
var aa = document.querySelectorAll("input[type=checkbox]"); | |
for (var i = 0; i < aa.length; i++){ | |
aa[i].checked = 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
#http://guides.rubygems.org/command-reference/ | |
gem install <gemName> | |
gem uninstall <gemName> | |
sudo gem install jekyll-contentblocks | |
gem list #LISTING INSTALLED GEMS | |
sudo gem update #Update installed gems to the latest version |
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
#https://github.com/creationix/nvm | |
nvm ls #If you want to see what versions are installed | |
nvm ls-remote #If you want to see what versions are available to install | |
nvm current | |
nvm install <version> | |
nvm install 0.12.3 | |
nvm install iojs 2.0.2 |
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
npm install tsd -g | |
tsd -h | |
tsd --version | |
#Install Packages/Libs | |
tsd query <itemName> --resolve --overwrite --save --action install | |
tsd query node --resolve --overwrite --save --action install | |
tsd query express body-parser cookie-parser morgan --resolve --overwrite --save --action install | |
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
#install bower | |
sudo npm install bower -g | |
#bower.json https://github.com/bower/bower.json-spec | |
bower init | |
#bower-installer Tool for installing bower dependencies that won't include entire repos | |
#https://www.npmjs.com/package/bower-installer | |
npm install -g bower-installer |