Skip to content

Instantly share code, notes, and snippets.

View nathanharper's full-sized avatar
🤠

Nathan Harper nathanharper

🤠
View GitHub Profile
@nathanharper
nathanharper / tinyurl.pl
Created September 27, 2012 21:37
Irssi script to convert URLs in messages to TinyURL
# I use iTerm2, which enables clicking to open URLs, but if the line wraps in the middle of one,
# iTerm2 does not recognize this. This script greatly decreases the chance that long URLs will wrap
# by using the Tiny URL API to shorten the URL. The script intercepts the message, and converts all URLs in place.
#
# DEPENDENCIES: must have the cURL command line utilities installed.
# DISCLAIMER: I don't use Windows, I don't know how cURL works on Windows, and I don't guarantee this will work. If it does, great!
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
@nathanharper
nathanharper / .vimrc
Created September 19, 2012 13:04
My .vimrc file
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
@nathanharper
nathanharper / tmux_irssi_niclist.sh
Last active October 29, 2018 08:39
A quick attempt to automate opening up a tmux session with Irssi and its nicklist.pl running.
#!/usr/bin/env bash
# This should work whether you are already in a TMUX session or not...
# Irssi directory is assumed to be in the user's home dir
if [ -z "$TMUX" ]
then
tmux new-session -d -s ircuser
tmux split-window -tircuser -h -l20
tmux send-keys -tircuser "tmux send-keys -t0 \"irssi\" C-m; \
tmux send-keys -t0 \"/set nicklist_height \$(stty size | cut -f1 -d' ' -)\" C-m; \
tmux send-keys -t0 \"/set nicklist_width \$(stty size | cut -f2 -d' ' -)\" C-m; \