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
# Python 2.x: | |
python -m SimpleHTTPServer | |
#Python 3.x: | |
python -m http.server |
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
$ grep -ri "word" . |
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
/** | |
* Clamps a number. Based on Zevan's idea: http://actionsnippet.com/?p=475 | |
* params: val, min, max | |
* Author: Jakub Korzeniowski | |
* Agency: Softhis | |
* http://www.softhis.com | |
*/ | |
(function(){Math.clamp=function(a,b,c){return Math.max(b,Math.min(c,a));}})(); |
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
alt+2=™ / ™ | |
alt+r=® / ® | |
alt+g=© / © | |
– / – | |
— / — | |
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
[alias] | |
lg1 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(green)%s%C(reset) %C(bold green)— %an%C(reset)%C(bold red)%d%C(reset)' --abbrev-commit --date=relative | |
lg2 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit | |
lg = !"git lg1" | |
delete-merged-branches = "!f() { git checkout --quiet develop && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f" |
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
# bash/zsh git prompt support | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
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
String.replace(/(\r\n|\n|\r)/gm,"").replace(/\s+/g," "); |
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
git remote prune -n |
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
# search your command-line history | |
history | grep 'querySelector' | |
# copy to clipboard | |
echo 'Hello World!' | pbcopy | |
# unzip an archive to the current directory | |
unzip -l images.zip | |
# find out what process are taking up the most memory |
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
// Small version | |
var provinces = [ | |
{plain:"Alberta",name:"Alberta",abbr:"AB"}, | |
{plain:"British Columbia",name:"British Columbia",abbr:"BC"}, | |
{plain:"Manitoba",name:"Manitoba",abbr:"MB"}, | |
{plain:"New Brunswick",name:"New Brunswick",abbr:"NB"}, | |
{plain:"Newfoundland & Labrador",name:"Newfoundland & Labrador",abbr:"NL"}, | |
{plain:"Northwest Territories",name:"Northwest Territories",abbr:"NT"}, | |
{plain:"Nova Scotia",name:"Nova Scotia",abbr:"NS"}, | |
{plain:"Nunavut",name:"Nunavut",abbr:"NU"}, |
OlderNewer