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
james@debbay:~/.vim$ git --version | |
git version 1.7.4.1 | |
james@debbay:~/.vim$ git status | |
# On branch master | |
# Your branch is ahead of 'origin/master' by 2 commits. | |
# | |
nothing to commit (working directory clean) | |
james@debbay:~/.vim$ mkdir bundle; cd bundle |
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
" Commands for fixing up whitespace | |
" note - we set gdefault later | |
cabbrev FixTabs s/\t/ / | |
cabbrev FixSpaces s/\s\+$// | |
nmap <Leader>wt :%FixTabs<Cr> | |
nmap <Leader>ws :%FixSpaces<Cr> | |
vmap <Leader>wt :FixTabs<Cr> | |
vmap <Leader>ws :FixSpaces<Cr> |
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 log(e) { | |
console.log(this, e, this.value, this.selectionStart, this.selectionEnd); | |
} | |
$(function() { | |
var events = 'focus click mousedown mouseout blur mouseover mouseout'.split(' '); | |
$.each(events, function(i) { | |
var e = events[i]; | |
$(':text')[e](function() { | |
log.call(this, e); |
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 | |
log_file="/tmp/ping.log" | |
do_ping() { | |
( | |
echo "==== Starting ping at `date` ====" | |
echo | |
ping 4.2.2.2 -c 4 | |
echo |
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
begin message: msg=0x100 (WM_KEYDOWN) hwnd=0x311f0 wparam=0x11 lparam=0x1d0001 result=0x0 | selected indices: 1 | |
end message: msg=0x100 (WM_KEYDOWN) hwnd=0x311f0 wparam=0x11 lparam=0x1d0001 result=0x0 | selected indices: 1 | |
begin message: msg=0x87 (WM_GETDLGCODE) hwnd=0x311f0 wparam=0x0 lparam=0x0 result=0x0 | selected indices: 1 | |
end message: msg=0x87 (WM_GETDLGCODE) hwnd=0x311f0 wparam=0x0 lparam=0x0 result=0x81 | selected indices: 1 | |
begin message: msg=0x87 (WM_GETDLGCODE) hwnd=0x311f0 wparam=0x0 lparam=0x0 result=0x0 | selected indices: 1 | |
end message: msg=0x87 (WM_GETDLGCODE) hwnd=0x311f0 wparam=0x0 lparam=0x0 result=0x81 | selected indices: 1 | |
begin message: msg=0x100 (WM_KEYDOWN) hwnd=0x311f0 wparam=0x43 lparam=0x2e0001 result=0x0 | selected indices: 1 |
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
begin message: msg=0x100 (WM_KEYDOWN) hwnd=0x211e2 wparam=0x11 lparam=0x1d0001 result=0x0 | selected indices: 1 | |
end message: msg=0x100 (WM_KEYDOWN) hwnd=0x211e2 wparam=0x11 lparam=0x1d0001 result=0x0 | selected indices: 1 | |
begin message: msg=0x87 (WM_GETDLGCODE) hwnd=0x211e2 wparam=0x0 lparam=0x0 result=0x0 | selected indices: 1 | |
end message: msg=0x87 (WM_GETDLGCODE) hwnd=0x211e2 wparam=0x0 lparam=0x0 result=0x81 | selected indices: 1 | |
begin message: msg=0x87 (WM_GETDLGCODE) hwnd=0x211e2 wparam=0x0 lparam=0x0 result=0x0 | selected indices: 1 | |
end message: msg=0x87 (WM_GETDLGCODE) hwnd=0x211e2 wparam=0x0 lparam=0x0 result=0x81 | selected indices: 1 | |
begin message: msg=0x100 (WM_KEYDOWN) hwnd=0x211e2 wparam=0x43 lparam=0x2e0001 result=0x0 | selected indices: 1 |
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
// http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ | |
function dbl_clawhammer($dir) { | |
global $create_dir_mode, $create_dir_group; | |
if ($dir && !is_dir($dir)) { | |
if (!rtorrent_xmlrpc('execute', array('mkdir', '-p', $dir))) { | |
throw new ErrorException("Failed to create directory '$dir'."); | |
} | |
if ($create_dir_mode && !rtorrent_xmlrpc('chmod', array($create_dir_mode, $dir))) { | |
throw new ErrorException("Failed to change directory mode for '$dir' to '$create_dir_mode'."); | |
} |
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 warnings; | |
use strict; | |
my $last_line = ""; | |
while (<>) { | |
if (/Successfully registered/) { | |
print $last_line; | |
print; |
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 | |
tz="`date +%z`" | |
for y in 2009 2010; do | |
for m in 01 02 03 04 05 06 07 08 09 10 11 12; do | |
touch -d "$y-$m-01 00:00:00 $tz -1 sec" min_date.txt | |
touch -d "$y-$m-01 00:00:00 $tz +1 month" max_date.txt | |
dir="$y-$m" | |
find -iname '*.jpg' \ |
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 inject(src, callback) { | |
if (typeof callback != 'function') callback = function() { }; | |
var el; | |
if (typeof src != 'function' && /\.css[^\.]*$/.test(src)) { | |
el = document.createElement('link'); | |
el.type = 'text/css'; | |
el.rel = 'stylesheet'; | |
el.href = src; |