Skip to content

Instantly share code, notes, and snippets.

View fitsum's full-sized avatar
💭
npx fitsum

ፍፁም fitsum

💭
npx fitsum
View GitHub Profile
@fitsum
fitsum / sed find|replace in line beginning with ...
Last active August 29, 2015 13:57
sed find line beginning w/ A replace `B` with `C ` in file D. OS X requires back up file to be set
sed -i .bak '/^A/s/B/C' D
@fitsum
fitsum / Access Control - Allow Origin
Created May 18, 2014 20:16
Access Control - Allow Origin
# .htaccess
#
# single
Header set Access-Control-Allow-Origin "*"
# multiple
Header add Access-Control-Allow-Origin "domain1"
Header add Access-Control-Allow-Origin "domain2"
Header add Access-Control-Allow-Origin "domain3"
@fitsum
fitsum / Bash random numbers
Last active August 29, 2015 14:01
Bash random numbers
# generate random intiger
$((RANDOM))
# get random integer no less than 1
$(((RANDOM%10)+1))
@fitsum
fitsum / keybase.md
Created July 14, 2014 19:32
keybase.md

Keybase proof

I hereby claim:

  • I am fitsum on github.
  • I am fitsum (https://keybase.io/fitsum) on keybase.
  • I have a public key whose fingerprint is 4BD8 4239 0E39 19EC 98A3 2C3C AB54 C36F 9A94 8A70

To claim this, I am signing this object:

@fitsum
fitsum / git lgs
Created June 8, 2015 22:27
pretty git logs
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --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(dim white)- %an%C(reset)' --all
@fitsum
fitsum / LOL in binary
Last active December 28, 2015 15:19
"LOL" en binaire -- http://bit.ly/XceX
01101100
01101111
01101100
@fitsum
fitsum / git-vlog
Created November 18, 2013 16:48 — forked from asabaylus/git-vlog
# Git visual log displays commit tree view with who did what when and in which branch
git config --global alias.vlog 'log --graph --date-order --date=relative --pretty=format:"%C(cyan)%h: %Cblue - %an - %Cgreen %C(cyan)%ar:%Creset%n%s%n" --color'
@fitsum
fitsum / splitcamelcase
Created February 16, 2016 19:34
add space between camel case loci
String.prototype.splitCamel = function(){
return this.replace(/([a-z](?=[A-Z]))/g, '$1 ')
}
bison || flacc
flex
qt5-default
libgtk-3-dev
libpcap0.8-dev
@fitsum
fitsum / node update.txt
Last active July 17, 2016 15:09
node update
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
from https://davidwalsh.name/upgrade-nodejs