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
[extensions] | |
strip = | |
rebase = | |
graphlog = | |
[alias] | |
pc = push -b . | |
pp = pull --update | |
ab = update --clean . |
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
package rei | |
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox | |
object Macros { | |
def ?[T](s: T): Option[T] = macro opt_impl[T] | |
def opt[T](s: T): Option[T] = macro opt_impl[T] |
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
module Main where | |
main :: IO() | |
main = getContents >>= putStrLn. show. maxFence 0. map (read:: String -> Int). words. last. lines | |
type Fence = [Int] | |
maxFence :: Int -> Fence -> Int | |
maxFence base [] = base | |
maxFence base [spike] = base + spike |
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
#!/bin/bash | |
#warns a user to log in as dev by a key instead of sudo su-ing every time | |
function get_ps { | |
pid=$1 | |
what=$2 | |
echo $(ps -o $what -p $pid h | tr -d ' ') | |
} | |
function get_parent { |
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
#!/bin/bash | |
# packs python scripts to an executable, the first script must be the main script | |
# example: pyzip quotes find_quotes.py dx.py | |
name=$(basename "$0") | |
usage="$name name_of_executable main_script.py [other python scripts]" | |
executable=${1?usage} | |
main_script=${2?usage} | |
scripts=${@:3} |
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
#!/bin/bash | |
#turn tcp dump into a text file: | |
# receiving_time -> fix_msg_sending_time | |
tcpdump -A -r - | strings | sed 's/\.\([[:digit:]]\+=\)/|\1/g' | sed 's/\.*$//g' | sed 's/^[^|]*|/|/g' | grep 'length\|8=FIX' | grep -B 1 '35=X' | grep -v '^--$' | cut -d ' ' -f 1 | sed 's/.*52=\([^|]*\).*/-> \1/g' | paste - - |
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
# usage: | |
# $ sudo apt-get install python-numpy | |
# $ python percentile.py 95 97 99 99.9 < my_file_with_floats | |
import numpy as np | |
import fileinput | |
import sys | |
lines = [] | |
for line in sys.stdin: |
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
$ for m in {32..33}; do for s in {00..59}; do echo "$m$s " `grep -c "$m$s" ~/input`; done; done > ~/out | |
$ gnuplot -p -e "set xdata time; set timefmt '%M%S'; set format x '%M:%S'; plot '~/out' using 1:2 with points" |
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
for d in `find . -name target`; do find $d -type f; done | xargs rm |
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
#!/bin/bash | |
#automated killing of maven debug plugin | |
#or anyone else if the port was specified | |
port=${1:-5005} | |
pid=`lsof -t -i :$port | tr -s ' ' | cut -d ' ' -f 2` | |
if [[ -z $pid ]]; then | |
echo "no one to kill 8'(" | |
else | |
echo "killing process listening on port $port \n`ps hp $pid`" |
NewerOlder