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
from IPython.core import ipapi | |
def istore(): | |
'''Extracts all variable names used in assignments from the input history | |
and stores them.''' | |
ipy = ipapi.get() | |
for v in assignees(assignments(ipy.history_manager.input_hist_raw)): | |
try: | |
ipy.magic('store %s' % v) | |
except: |
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 python | |
# Add this to: .git/hooks/pre-commit | |
# if ! git diff-index --check $against > /dev/null 2>&1; then | |
# git diff --cached --name-status | $(HOME)/bin/linecleaner.py | |
# fi | |
import sys | |
import re | |
import fileinput |
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
from cookielib import CookieJar, Cookie | |
import sqlite3 | |
import os | |
import shutil | |
import tempfile | |
__all__ = ['ChromeCookieJar'] | |
def to_epoch_seconds(chrome_timestamp): | |
return chrome_timestamp - 11644473600 * 1000 * 1000 |
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
# export files from branch into a folder for releasing | |
git archive master | tar -x -C /tmp/test/ |
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
(custom-set-variables | |
'(dabbrev-upcase-means-case-search t) | |
'(tags-revert-without-query t) | |
'(custom-file "~/.emacs") | |
'(blink-cursor-mode nil) | |
'(dabbrev-case-fold-search t) | |
'(iswitchb-mode t nil (iswitchb)) | |
'(global-font-lock-mode t nil (font-lock))) | |
(setq-default fill-column 80) | |
(setq-default column-number-mode t) |
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
mvn -D'test=package.ClassTest' verify | |
# print http headers and body | |
tshark -R 'http' -S -V -l | awk '/^[HL]/ {p=30} /^[^ HL]/ {p=0} /^ / {--p} {if (p>0) print}' |
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
keycode 135 = Control_R | |
add Control = Control_R | |
keycode 134 = Menu |
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
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... and ignore same sucessive entries. | |
export HISTCONTROL=ignoredups:ignoreboth:ingorespace | |
export HISTFILESIZE=100000 | |
export HISTSIZE=10000 | |
# have shells append to your history | |
shopt -s histappend | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. |
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 export_file { | |
line=$1 | |
file=$(echo $line | awk '{print $3}') | |
prefix=$(echo $line | cut -d':' -f1) | |
eval "export f${counter}=${file}" | |
echo "${prefix}: f${counter} ${file}" | |
let counter=$counter+1 | |
} | |
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 com.sun.jersey.spi.container.ContainerRequest; | |
import com.sun.jersey.spi.container.ContainerResponse; | |
import com.sun.jersey.spi.container.ContainerResponseFilter; | |
import com.sun.jersey.spi.container.ContainerResponseWriter; | |
import javax.ws.rs.core.HttpHeaders; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; | |
import java.io.IOException; |
NewerOlder