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
#!/usr/bin/env sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |
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
TRACE: /dev/shm/test.cpp(27): int main(int, char**) | |
TRACE: /dev/shm/test.cpp(20): void where_am_I(int) | |
LOG: /dev/shm/test.cpp(22): void where_am_I(int) | |
x(3) is odd. | |
LOG: /dev/shm/test.h(10): void where_are_you() | |
Here I am! |
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
#!/usr/bin/env python | |
import urllib | |
import urllib2 | |
import sys | |
if len(sys.argv) > 1: | |
lang = sys.argv[1] | |
else: |
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
#!/usr/bin/env python3 | |
# coding: utf8 | |
# GistID: 8232376 | |
import optparse | |
import sys | |
from subprocess import check_call | |
from urllib.parse import urlparse, quote, urlencode | |
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
''' | |
Set ANSI Terminal Color and Attributes. | |
''' | |
from sys import stdout | |
esc = '%s['%chr(27) | |
reset = '%s0m'%esc | |
format = '1;%dm' | |
fgoffset, bgoffset = 30, 40 | |
for k, v in dict( |
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 | |
# Don't put duplicate lines in the history | |
export HISTCONTROL=ignoredups | |
# Store a lot history entries in a file for grep-age | |
shopt -s histappend | |
export HISTFILE=~/long_history | |
export HISTFILESIZE=50000 |
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
#!/usr/bin/env ruby | |
# GistID: 4717831 | |
# | |
# splitpatch is a simple script to split a patch up into multiple patch files. | |
# if the --hunks option is provided on the command line, each hunk gets its | |
# own patchfile. | |
# | |
# Copyright (C) 2007, Peter Hutterer <peter@cs.unisa.edu.au> | |
# | |
# This program is free software; you can redistribute it and/or modify |
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
#!/usr/bin/env perl | |
use 5.013; | |
use warnings; | |
use Data::Dumper; | |
use File::Basename; | |
use File::Spec::Functions; | |
use File::Path qw(make_path); | |
my $pdftk = `/usr/bin/which pdftk`; |
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
#/usr/bin/env python | |
from pandas import np | |
from pandas.io.data import DataReader | |
def historical_volatility(sym, days): | |
"Return the annualized stddev of daily log returns of `sym`." | |
try: | |
quotes = DataReader(sym, 'yahoo')['Close'][-days:] |
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
# coding: utf8 | |
# distutils: language = c++ | |
# distutils: sources = b.cpp | |
# Using C calling convention works with "cdef extern ..." directly; no | |
# hpp header. | |
# Without it we need to use the cdef extern from "b.hpp": ... declaration. | |
# Implicitly forces C calling convenction? | |
cdef extern void c() |
NewerOlder