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
| // source: http://blog.caustik.com/2012/08/19/node-js-w1m-concurrent-connections/ | |
| // includes | |
| var cluster = require('cluster'); | |
| var cpuCount = require('os').cpus().length; | |
| var util = require("util"); | |
| var http = require("http"); | |
| var url = require('url'); | |
| var fs = require('fs'); | |
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
| <ul> | |
| <li data-tab="bla1">asdf</li> | |
| <li data-tab="bla2">sadfaf</li> | |
| <li data-tab="bla3">asdfa</li> | |
| </ul> |
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
| wget https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz | |
| tar xf go1.3.3.linux-amd64.tar.gz | |
| rm go1.3.3.linux-amd64.tar.gz | |
| echo "export GOROOT=\$HOME/go" >> ~/.profile | |
| echo "PATH=$PATH:\$GOROOT/bin" >> ~/.profile | |
| source ~/.profile |
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
| /* | |
| * Minimal A/B Testing | |
| * | |
| * @author Franklin Javier (@franklinjavier) | |
| * @date Nov 2014 | |
| * | |
| * @example ABTest('variant1, variant2'); // return one of these | |
| * | |
| */ |
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 uuid() { | |
| // from http://stackoverflow.com/questions/105034 | |
| return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
| var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
| return v.toString(16); | |
| }); | |
| }; |
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
| <style> | |
| #expr { | |
| width: 100%; | |
| height: 300px; | |
| } | |
| body, textarea, button { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| } |
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
| basetime=$(date +%s%N) && | |
| grep --color=auto -rnw 'try.lisp' -e "macbook.*apple" -e "apple.*macbook" | wc -l && | |
| echo "runtime: $(echo "scale=3;($(date +%s%N) - ${basetime})/(1*10^09)" | bc) seconds" | |
| #grep "apple" try.lisp | grep "macbook" | grep "WordPress" | wc -l | |
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
| rsync -azrvhP --rsh="ssh -p2222" --exclude-from "$HOME/r00t/dotFiles/.ignore" /path-local/ user@domain.com:/path-remote/ |
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
| #!/bin/bash | |
| if [ $1 = "up" ]; then | |
| rsync -azP $2 site@franklinjavier.com:$3 | |
| else | |
| rsync -azP site@franklinjavier.com:$2 $3 | |
| fi | |
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
| #!/bin/bash | |
| echo "vim-scp FTW" | |
| if [ $# -ne 2 ]; then | |
| echo "usage : `basename $0` user@host /path" | |
| exit 1 | |
| fi | |
| COMMAND="ssh $1 -f -N -o ControlMaster=auto -p 21 -o ControlPath=/tmp/%r@%h:%p" | |
| echo "opening ssh tunnel.." | |
| $COMMAND || exit $? | |
| echo "ssh tunnel active, opening vim.." |