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
via http://coderwall.com/p/euwpig?i=3&p=1&t=git | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
git config --global alias.df "diff -U --color" | |
git config --global alias.st "status -sb" | |
#new branch | |
git config --global alias.nb "checkout -b" |
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
function getAllMethods(object) { | |
return Object.getOwnPropertyNames(object).filter(function(property) { | |
return typeof object[property] == 'function'; | |
}); | |
} | |
console.log(getAllMethods(String).sort()); |
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
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
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
//http://stackoverflow.com/questions/5186638/how-to-asynchronously-load-css-using-jquery/32614409#32614409 | |
var stylesheet = document.createElement('link'); | |
stylesheet.href = '/inc/body/jquery/css/start/jquery-ui-1.8.10.custom.css'; | |
stylesheet.rel = 'stylesheet'; | |
stylesheet.type = 'text/css'; | |
// temporarily set media to something inapplicable to ensure it'll fetch without blocking render | |
stylesheet.media = 'only x'; | |
// set the media back when the stylesheet loads | |
stylesheet.onload = function() {stylesheet.media = 'all'} |
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
# Note: ~/.ssh/environment should not be used, as it | |
# already has a different purpose in SSH. | |
env=~/.ssh/agent.env | |
# Note: Don't bother checking SSH_AGENT_PID. It's not used | |
# by SSH itself, and it might even be incorrect | |
# (for example, when using agent-forwarding over SSH). | |
agent_is_running() { |
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
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
ssh-add ~/.ssh/id_rsa | |
eval "$(ssh-agent -s)" (windows) | |
clip < ~/.ssh/id_rsa.pub | |
https://github.com/settings/ssh |
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
Any objects that are scope acessible to a closure is scope acessible to all closures of that same scope level |
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
# Get root up in here | |
sudo su | |
# Update and begin installing some utility tools | |
apt-get -y update | |
#install git | |
apt-get install git-all | |
# Get latest version of node |
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
idx = (p, o) => p.replace(/\[/g,'.').replace(/\]/g, '').split('.').reduce((xs, x) => (typeof xs !== 'undefined' && typeof xs[x] !== 'undefined') ? xs[x] : undefined, o) |
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
// Taken from regex at bottom of this section https://html.spec.whatwg.org/#e-mail-state-(type=email) | |
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; |
OlderNewer