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
YELLOW='\033[0;33m' | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
BLUE='\033[0;34m' | |
NC='\033[0m' # No Color | |
function loc { | |
if [ -z "$1" ] || [ "$1" == "all" ]; then | |
loc js "$2" | |
loc jsx "$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
package main | |
// "Fork" Geth | |
// add: | |
// func DecryptKeyFromFile(keysDirPath string, keyAddr common.Address, auth string) (keyBytes []byte, keyId []byte, err error) { | |
// return decryptKeyFromFile(keysDirPath, keyAddr, auth) | |
// } | |
// to crypto/key_store_passphrase.go | |
import ( |
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
module My.Data.List where | |
data List a = Cons a (List a) | Nil | |
instance showList :: (Show a) => Show (List a) where | |
show (Cons x xs) = (show x) ++ " : " ++ show xs | |
show Nil = "Nil" |
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
YELLOW='\033[0;33m' | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
BLUE='\033[0;34m' | |
NC='\033[0m' # No Color | |
alias root="sudo -i" | |
# utility function | |
function current_usage { |
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
YELLOW='\033[1;33m' | |
NC='\033[0m' # No Color | |
# Usage: | |
# m → mix help | |
# m a → mix archive | |
# m h → mix hex | |
# m a.b → mix archive.build | |
# m d.co → mix deps.compile | |
# m p.n → mix phoenix.new |
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
# Example: | |
# | |
# $ find . | grep core_ext | |
# ./config/initializers/core_ext.rb | |
# ./spec/lib/core_ext_spec.rb | |
# | |
# $ grab 2 | |
# ./spec/lib/core_ext_spec.rb ===> (also copied on clipboard) | |
# | |
# Without arguments the default is to grab the first line |
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
# swiss knife | |
function c { | |
local dir | |
dir=`pwd` | |
if [ -z "$1" ]; then | |
cd - > /dev/null | |
else | |
if [ -d "$1" ]; then | |
cd "$1" | |
elif [ -f "$1" ]; then |
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 rspec { | |
command rspec $@ | |
if [ $? -ne 0 ]; then | |
afplay ~/Misc/dumb.mp3 -v 0.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
# p proj -> cd ~/Projects/project | |
# works best (fastest) if your projects are lower-case and you refer to them as such | |
# if not, then for best performance (no lag) you have to call "p Proj" (if ~/Projects/Project exists) | |
function p { | |
cd ~/Projects | |
local match | |
if [ -n "$1" ]; then | |
local min_size=1000 | |
# first try only directories that start exactly with our input | |
for d in $1*/ ; do |
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: web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8888/client')); | |
// eth has to run on 8090: | |
// eth -j -m 10 -n off --json-rpc-port 8090 | |
// GO: ethereum -rpcport=8090 -rpc=true -mine=true | |
// static server based on: https://gist.github.com/ryanflorence/701407 | |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), |