Skip to content

Instantly share code, notes, and snippets.

" Set leader to ,
let mapleader = ","
" Let me create hidden buffers
set hidden
" Turn of compatibility mode
set nocompatible
" Activate blinking cursor (restore defaults)
Go through the tutorial at http://postpostmodern.com/instructional/screenwatcher/ and then come back here.
Here’s the way I got it to work on OS X Leopard.
Change the shell script to:
#!/bin/bash
PID=`ps -ax | grep loginwindow.app | grep -v grep | awk '{print $1}'`
# Change to a Screenwatcher directory in your home directory
cd /Users/patrick/Pictures/Screenwatcher
@halbtuerke
halbtuerke / Instructions
Created October 17, 2010 18:20
Join multiple *.flv files with ffmpeg
To use this script just copy all flv files into a directory and call the script via:
"join-flvs.sh *.flv"
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
set completion-ignore-case On
set show-all-if-ambiguous on
"\e[A": history-search-backward
"\e[B": history-search-forward
# Cycle through completions by pressing tab
"\t": menu-complete
@halbtuerke
halbtuerke / handbrake-batch.sh
Created October 22, 2010 06:29
Batch convert videos with HandBrake CLI
#!/bin/sh
# This script converts any kind of video the HandBrake CLI can handle
# into a 1000 kbit MPEG4 video and shrinks it down to a max width of 640 px.
#
# Usage:
# Running the script without any parameters just uses *all* files in the
# current directory and converts them, so make sure you only have video files
# in the directory you're in.
#
@halbtuerke
halbtuerke / init.el
Created September 7, 2015 18:46
Save and restore shell buffers with desktop.el
(add-hook 'shell-mode-hook
(lambda ()
(make-local-variable 'desktop-save-buffer)
(setq desktop-save-buffer
(lambda (desktop-dirname)
default-directory))))
(defun shell-restore-desktop-buffer (file-name buffer-name directory)
(setq default-directory directory)
(shell))

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
#!/bin/bash
# Runs the specified command (provided by the first argument) in all tmux panes
# for every window regardless if applications are running in the terminal or not.
function execute_in_all_panes {
# Notate which window/pane we were originally at
ORIG_WINDOW_INDEX=`tmux display-message -p '#I'`
ORIG_PANE_INDEX=`tmux display-message -p '#P'`
@halbtuerke
halbtuerke / about.md
Created November 26, 2011 23:57 — forked from basus/about.md
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of this other gist which is itself a fork of a gist from this blog post.