person = Person.new('Jo', 'Bloggs')
HumanName.new(person).full_name
> "Joe Bloggs"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example from http://mikepackdev.com/blog_posts/31-exhibit-vs-presenter | |
class Decorator < SimpleDelegator | |
end | |
class Car | |
def price | |
1_000_000 | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |