Skip to content

Instantly share code, notes, and snippets.

@nathyong
nathyong / tt.py
Last active Aug 29, 2015 — forked from C0mkid/tt.py
View tt.py
#!/usr/bin/python2.7
from subprocess import check_output, STDOUT, CalledProcessError, call
from sys import argv, stdout, stdin
def run(func):
"""Run a function and capture the output."""
if type(func) != type([]) and type(func) == type(""):
func = func.split(' ')
@nathyong
nathyong / tt.plugin.zsh
Created Oct 24, 2014
save into ~/.oh-my-zsh/custom/plugins/tt/tt.plugin.zsh
View tt.plugin.zsh
# lovingly ripped off the _tmux completion module included in zsh
function __tmux-sessions() {
local expl
local -a sessions
sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} )
_describe -t sessions 'sessions' sessions "$@"
}
function _tmux-attach-session() {
@nathyong
nathyong / irssi-terminal-notify.pl
Created Oct 13, 2014
A short script to link irssi to the OSX Notification Center. Requires terminal-notifier.
View irssi-terminal-notify.pl
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load irssi-terminal-notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);