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
" version control blame of selected lines | |
"vmap <Leader>b :<C-U>!svn blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> | |
vmap <Leader>g :<C-U>!git blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> | |
vmap <Leader>h :<C-U>!hg blame -fu <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> |
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
// Main.scala | |
class C { | |
var x = 0 | |
} | |
object Main extends App { | |
val c = new C() | |
println("c = " + c.x) | |
} |
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
import sys | |
class TestTriedToAccessNetwork(BaseException): | |
pass | |
if 'test' in sys.argv: | |
import socket | |
class PatchedSocket(socket.socket): |
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
#!/usr/bin/env bash | |
# N.B. requires patch queues (mq) enabled in your .hgrc. to finish this up | |
# and turn into a real commit, do `hg qfinish -a` | |
now=`date +"%s"` | |
patch_name='$now-temporary' | |
hg qnew $patch_name | |
hg qpop |
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
#!/usr/bin/env bash | |
open -a /Applications/IntelliJ\ IDEA\ 13\ CE.app/ pom.xml | |
# best as a bash alias :) |
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
/** | |
<dependency> | |
<groupId>org.fusesource.leveldbjni</groupId> | |
<artifactId>leveldbjni-all</artifactId> | |
<version>1.7</version> | |
</dependency> | |
*/ | |
import com.google.common.base.Optional; | |
import org.iq80.leveldb.DB; |
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
#!/usr/bin/ruby | |
# ************************************************************************** | |
# ### modified based on: | |
# http://stackoverflow.com/questions/123378/command-line-unix-ascii-based-charting-plotting-tool | |
# ### | |
# eplot | |
# Written by Christian Wolf | |
# | |
# eplot ("easy gnuplot") is a shell script which allows to pipe data easily | |
# through gnuplot and create plots quickly, which can be saved in postscript, |
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
# requirements.txt | |
# pip install requests | |
# pip install BeautifulSoup4 | |
import codecs | |
import requests | |
from bs4 import BeautifulSoup | |
PER_LINE = 12 |
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
#!/usr/bin/env bash | |
################################################################################ | |
# Use as a global mercurial/git pre commit or pre push hook to detect the type | |
# of project and run unittests before allowing a commit or push to a remote | |
# repository. | |
# | |
# Handy so that you don't have to remember to add test running hooks to every | |
# repo clone/fork you have. | |
# | |
# ********** MERCURIAL SETUP ************* |
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
# loop foreva-eva | |
def loop(sequence): | |
while True: | |
for elem in sequence: | |
yield elem | |
# example usage, imagine you have a set of things you want | |
# to cycle through, removing bad ones as they appear | |
class ObjectPoolEmptyError(Exception): |