sudo apt-get install libxml2-dev libxslt-dev
pip install scrapy
pip install python-dateutil
When running scrapy, this bash script is handy:
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Spanish to English Papercuts</name> | |
<item> | |
<name>Swap '§' and '`'</name> | |
<identifier>private.spanish_english_papercuts_backquote</identifier> | |
<autogen>__KeyToKey__ KeyCode::UK_SECTION, KeyCode::BACKQUOTE</autogen> | |
<autogen>__KeyToKey__ KeyCode::BACKQUOTE, KeyCode::UK_SECTION</autogen> | |
</item> |
term xterm-color | |
altscreen on | |
hardstatus on | |
hardstatus alwayslastline | |
startup_message off | |
termcapinfo xterm ti@:te@ | |
hardstatus string "%{= kG}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " |
html { | |
font: 13px/1.3em 'Lucida Grande' sans-serif; | |
background-color: #eee; | |
color: #333; | |
word-wrap: break-word; | |
margin: 0; | |
padding: 0; | |
} | |
body { |
def countComb(coins, change, solutions, current): | |
ret = 0 | |
if sum(current) < change: | |
for coin in coins: | |
newComb = [c for c in current] | |
newComb.append(coin) | |
ret += countComb(coins, change, solutions, newComb) | |
if sum(current) == change: | |
current.sort() | |
if current not in solutions: |
var request = require('request'); | |
var api_key = "<KLOUT_API_KEY>"; | |
var handles = ["user1", "user2"]; | |
var twitter_url = "http://api.klout.com/v2/identity.json/twitter?screenName="; | |
var klout_url = "http://api.klout.com/v2/user.json/:klout_id/score?"; | |
var user, sum = 0, idx = 0; | |
function addUpUser(){ |
export CLICOLOR=1 | |
# Modifies PS1 when called (to fix line-wrapping issues) | |
hg_branch() { | |
red=$(tput setaf 1) | |
reset=$(tput sgr0) | |
branch=`hg branch 2> /dev/null | awk '{print $1}'` | |
if [[ -n $branch ]]; then | |
PS1="$PS1 \[$red\](\[$reset\]$branch\[$red\])\[$reset\]" | |
fi |
[alias] | |
st = status | |
ci = commit | |
co = checkout | |
di = diff -w | |
dic = diff -w --cached | |
ll = log --date local --no-merges --format='%C(yellow)%h%Creset %ad %Cgreen%aN%Creset %s' | |
forgot = commit --amend -C HEAD | |
branches = branch -av | |
fbranch = !git ll master..`git rev-parse --abbrev-ref HEAD` |
# screen | |
which screen > /dev/null | |
SCREEN=($?) | |
if [[ -n "$SSH_CONNECTION" && -z "$STY" && "$SCREEN" -eq "0" ]]; then | |
# Screen is not currently running, but we are in SSH, so start a session | |
exec screen -D -R | |
fi |
from BeautifulSoup import BeautifulSoup | |
import json | |
import sys | |
if len(sys.argv) < 2: | |
print sys.argv[0] + ' <input file>' | |
else: | |
in_file = sys.argv[1] | |
if len(sys.argv) < 3: | |
tag = 'div' |