This file contains 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
raise "bad email" unless "[email protected]" =~ /@(.*)/ | |
return $1 |
This file contains 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
#!/bin/sh | |
SUBDIRECTORY_OK=Yes | |
. git-sh-setup | |
require_work_tree | |
ref_stash=refs/stash | |
COLOR_RED="\e[0;31m" | |
COLOR_GREEN="\e[32;40m" |
This file contains 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
plugin do | |
def tinysong(title, artist) | |
response = Net::HTTP.new("tinysong.com").start do |h| | |
req = Net::HTTP::Get.new("?s=#{URI.escape "#{t.name} by #{t.artist}"}") | |
r.add_field("X-Requested-With", "XMLHttpRequest") | |
h.request(req) | |
end | |
response.body =~ %r{"(http:\\/\\/tinysong.com.+?)"} ? $1.gsub("\\", "") : nil | |
end | |
This file contains 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
# Serializing of Ruby objects compatible with PHP’s unserialize() function | |
# Ciarán Walsh | |
require 'enumerator' | |
class Float | |
def serialize | |
['d', self].join(':') + ';' | |
end | |
end | |
class Integer |