Skip to content
View wunderlist2todotxt
#!/usr/bin/env ruby
require 'json'
require 'date'
wunderlist = JSON.parse( ARGV[0])
tasks, lists = wunderlist['data']["tasks"], wunderlist['data']["lists"]! do |task|
due_date = task["due_date"]
View .xinitrc
setxkbmap -option caps:swapescape
sh ~/.fehbg &
devmon &
exec i3
View BBC-Radio.m3u
#EXTINF:-1,BBC - Radio 1
#EXTINF:-1,BBC - Radio 2
#EXTINF:-1,BBC - Radio 3
#EXTINF:-1,BBC - Radio 4
#EXTINF:-1,BBC - Radio 5 live
View angular_form_builder.rb
# Adds ng-model attrs to all formatastic inputs
# based on ActiveModel naming conventions
class AngularFormBuilder < Formtastic::FormBuilder
# Almost exact dupilicate of the formtastic input method
# but thhe magick is in the extends :) (Line 13)
def input(method, options = {})
method = method.to_sym if method.is_a?(String)
options = options.dup
options[:as] ||= default_input_type(method, options)
View routes.rb
MyApp::Application.routes.draw do
# External urls
scope host: '' do
get 'thing' => 'dev#null', as: :thing
# Use thing_url in your veiws (thing_path would not include the host)
# thing_url => ""
View mpc
#Wrapper for mpc including host
export MPD_HOST=`cat /etc/mpdhost`
/usr/bin/mpc $@
View Fix rxvt-unicode via

If tmux fails with the message "open terminal failed: missing or unsuitable terminal: rxvt-unicode-256color".

$ ssh remotemachine mkdir -p .terminfo/r
$ scp /usr/share/terminfo/r/rxvt-unicode* remotemachine:.terminfo/r/
View vcr.rb
VCR.configure do |c|
c.register_request_matcher :xml_body do |request_1, request_2|
EquivalentXml.equivalent?(request_1.body, request_2.body)
c.ignore_localhost = true
c.cassette_library_dir = Rails.root.join("spec", "support", "vcr_cassettes")
c.hook_into :webmock
c.default_cassette_options = { match_requests_on: [:method, :uri, :xml_body] }
# c.debug_logger ="#{Rails.root}/log/vcr.log", 'w')
View music.yml
# ~/.tmuxinator/music.yml
project_name: Musix
project_root: ~/Music
pre: mopidy -q &> ~/.mopidy.log &
- interface: ncmpcpp
- radio: bbcradio
- mixer: alsamixer
- mopodiy: tail -f ~/.mopidy.log
View manager.rb
def months_til_renewal
months = 0
date_to_check = Date.current
while(date_to_check < current_period_ends_at.to_date) do
date_to_check = date_to_check.next_month
months += 1
Something went wrong with that request. Please try again.