Skip to content

Instantly share code, notes, and snippets.

@stengland
stengland / wunderlist2todotxt
Last active September 29, 2015 08:47
Convert wunderlist tasks to todo.txt file
#!/usr/bin/env ruby
require 'json'
require 'date'
wunderlist = JSON.parse(File.read ARGV[0])
tasks, lists = wunderlist['data']["tasks"], wunderlist['data']["lists"]
tasks.map! do |task|
due_date = task["due_date"]
@stengland
stengland / README.md
Last active December 16, 2015 20:49 — forked from jordelver/README.md

Usage

Normal

person = Person.new('Jo', 'Bloggs')
    
HumanName.new(person).full_name
> "Joe Bloggs"
@stengland
stengland / gist:3347696
Created August 14, 2012 09:07 — forked from jordelver/gist:3230399
Ruby simple delegator
# Example from http://mikepackdev.com/blog_posts/31-exhibit-vs-presenter
class Decorator < SimpleDelegator
end
class Car
def price
1_000_000
end
end
@stengland
stengland / volume.rb
Created April 26, 2012 09:15 — forked from uriel1998/volume.rb
Set pulseaudio volume from the command line using ruby
#!/usr/bin/env ruby
# Changed bit of code toggling mute - was throwing errors for me.
# Added output, so it could be piped to a notify-osd or somesuch if desired.
# Pulseaudio volume control
class Pulse
attr_reader :volumes, :mutes
# Constructor