Skip to content

Instantly share code, notes, and snippets.

@viktorkelemen
viktorkelemen / gist:3992144
Created November 1, 2012 06:18
Retrieving the results of last command
zmodload -i zsh/parameter
insert-last-command-output() {
LBUFFER+="$(eval $history[$((HISTCMD-1))])"
}
zle -N insert-last-command-output
bindkey "^X^L" insert-last-command-output
@viktorkelemen
viktorkelemen / gist:3233808
Created August 2, 2012 05:00
List of git branches ordered by most recent commit
git for-each-ref --count=10 \
--sort=-committerdate refs/heads/ \
--format='%(refname) %(committerdate) %(authorname)' \
| sed 's/refs\/heads\///g'
@viktorkelemen
viktorkelemen / gist:3142776
Created July 19, 2012 09:54
Turning off all plugins in Janus
cd ~/.vim; for submodule in `git submodule | grep -v core | awk '{print $2}'`; do
echo "call janus#disable_plugin('`basename ${submodule}`')" >> ~/.vimrc.before;
done
@viktorkelemen
viktorkelemen / gist:3110220
Created July 14, 2012 09:39
pbcopy and pbpaste
# pbcopy
cat FILE | pbcopy
ls | pbcopy
# pbpaste
pbpaste > NEW_FILE
@viktorkelemen
viktorkelemen / gist:3082055
Created July 10, 2012 08:35
Gource with ffmpeg
gource -1280x720 --seconds-per-day 0.1 --key --hide dirnames, -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -crf 1 -threads 0 -bf 0 output.mp4
@viktorkelemen
viktorkelemen / gist:2894833
Created June 8, 2012 10:10
Listing all unicode characters
var counter = 0,
timer;
timer = setInterval( function () {
counter += 1;
if (counter < 95221) {
console.log(String.fromCharCode(counter));
} else {
clearTimeout(timer);
}
@viktorkelemen
viktorkelemen / gist:2575598
Created May 2, 2012 09:46
Reload the active tab in Chrome with AppleScript
tell application "Google Chrome"
reload active tab of window 1
end tell
@viktorkelemen
viktorkelemen / gist:2572745
Created May 2, 2012 00:56
git diff stash
// get a list of stashes
git stash list
// stash diff where the number is the index in the stash list
git diff stash@{0}
// stash@{0} is the default
git diff stash
@viktorkelemen
viktorkelemen / gist:1924761
Created February 27, 2012 15:40
Google Search History RSS
// num - number of items
// start - starting point
https://www.google.com/history/lookup?q=&output=rss&num=1000&start=0
// the first 1000 history items started from the 100th
https://www.google.com/history/lookup?q=&output=rss&num=1000&start=100
@viktorkelemen
viktorkelemen / gist:1801841
Created February 11, 2012 16:31
my .screenrc
# Instead of Control-a, make the escape/command character be Control-x
escape ^Xx
# Autodetach session on hangup instead of terminating screen completely
autodetach on
# Turn off the splash screen
startup_message off
# Use a 30000-line scrollback buffer