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
# | |
# Installation: | |
# | |
# - Save me at ~/.irssi/scripts/notify.pl | |
# | |
# - In ~/.irssi/scripts: | |
# 1. $ mkdir autorun | |
# 2. $ cd autorun | |
# 3. $ ln -s ../notify.pl notify.pl | |
# |
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 bash | |
# Custom move command that will create the destination directory if it does not | |
# exist. | |
function my_mv() { | |
# If two arguments were passed and the first argument was a file that exists | |
if [[ $# == 2 && -e $1 ]] | |
then | |
# Get the directory name of the second argument ("testing/test.txt" -> | |
# "testing") |
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
/*global _:true */ | |
/** | |
* Args builds an object with a property for each query argument in the query | |
* portion of a url. Properties on the object can then be modified and an | |
* updated url with query string can be produced from the Args instance. | |
*/ | |
function Args(url) { | |
var self = this; |
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/sh | |
formail -D 10000000 idcache < "$1" -s > ztmp && mv ztmp "$1" | |
rm idcache |
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
function d { | |
if [[ $1 == "-f" ]]; then | |
if [[ -n $2 ]]; then | |
pushd $WORKON_HOME/$2/src/django-fusionbox | |
else | |
__d_help | |
fi | |
elif [[ -n $1 ]]; then | |
pushd $(__d_get_site_packages_dir $1)/django | |
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
# For bash | |
function _d { | |
COMPREPLY=(); | |
cur="${COMP_WORDS[COMP_CWORD]}"; | |
if [ $COMP_CWORD -eq 1 ]; then | |
opts=$(find $WORKON_HOME -maxdepth 1 -type d | awk -F/ '{ if ( $NF ~ /^[^.]/ ) print $NF }'); | |
COMPREPLY=( $(compgen -W "$opts" -- $cur) ); | |
fi | |
} |
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
" With pathogen: place in ~/.vim/bundle/quicktab/plugin | |
" Without pathogen: place in ~/.vim/plugin | |
" Sets tab size to `size`. | |
function! QuickTabSet(size) | |
let &tabstop = a:size | |
let &softtabstop = a:size | |
let &shiftwidth = a:size | |
echo 'Changed tab size to '.a:size.' spaces' | |
endfunction |
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 sys | |
import random | |
if __name__ == '__main__': | |
contents = sys.stdin.readlines() | |
random.shuffle(contents) | |
sys.stdout.write(''.join(contents)) |
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 argparse | |
from fractions import Fraction | |
MAX_BRIGHTNESS_FILE = '/sys/class/backlight/intel_backlight/max_brightness' | |
BRIGHTNESS_FILE = '/sys/class/backlight/intel_backlight/brightness' | |
if __name__ == '__main__': |
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
server { | |
listen 80; | |
server_name example.com; | |
charset utf-8; | |
location /static/ { | |
alias /var/www/example.com/static/; | |
} |
OlderNewer