Skip to content

Instantly share code, notes, and snippets.

View jeffkreeftmeijer's full-sized avatar
🦞

Jeff Kreeftmeijer jeffkreeftmeijer

🦞
View GitHub Profile
class Array
def swap(a,b)
swapped = self.clone
swapped[a], swapped[b] = self[b], self[a]
swapped
end
end
<?xml version="1.0" encoding="utf-8"?>
<lfm status="ok">
<similarartists artist="Metallica">
<artist>
<name>Megadeth</name>
<mbid>a9044915-8be3-4c7e-b11f-9e2d2ea0a91e</mbid>
<match>100</match>
<url>www.last.fm/music/Megadeth</url>
<image size="small">http://userserve-ak.last.fm/serve/34/25013983.jpg</image>
<image size="medium">http://userserve-ak.last.fm/serve/64/25013983.jpg</image>
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/osx/plist.bundle: dlopen(/Applications/TextMate.app/Contents/SharedSupport/Support/lib/osx/plist.bundle, 9): no suitable image found.  Did find: (LoadError)
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/osx/plist.bundle: no matching architecture in universal wrapper - /Applications/TextMate.app/Contents/SharedSupport/Support/lib/osx/plist.bundle
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:3
from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/stdin_dialog.rb:1:in `require'
from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/stdin_dialog.rb:1
puts 'please type the text you want to #hashtagerize and press [ENTER]...'
open 'http://twitter.com/?status=#' << gets.split(' ').join(' #').gsub('#@', '@')
@jeffkreeftmeijer
jeffkreeftmeijer / hashtagerize.rb
Created November 26, 2009 16:03 — forked from matsimitsu/hashtagerize.rb
#Hashtagerize. The wet dream of hashtag-overusing-idiots out there.
#!/usr/bin/ruby
require 'cgi'
# #Hashtagerize. The wet dream of hashtag-overusing-idiots out there.
# You know who you are. Stop it.
IO.popen 'open http://twitter.com/?status=' << CGI::escape(ARGV.collect { |word| word[0] == 64 ? word : "##{word}" }.join(' '))
puts 'please type the text you want to #hashtagerize and press [ENTER]...'
open 'http://twitter.com/?status=#' << gets.split(' ').collect { |word| word[0] == 64 ? word : "##{word}" }.join(' ')
puts 'please type the text you want to #hashtagerize and press [ENTER]...'
open 'http://twitter.com/?status=' << gets.split(' ').collect { |word| word[0] == 64 ? word : "##{word}" }.join(' ')
#!/usr/bin/ruby
require 'cgi'
# #Hashtagerize. The wet dream of hashtag-overusing-idiots out there.
# You know who you are. Stop it.
puts 'please type the text you want to #Hashtagerize and press [ENTER]...'
IO.popen 'open http://twitter.com/?status=' << CGI::escape(gets.split(' ').collect { |word| word[0] == 64 ? word : "##{word}" }.join(' '))
I released a simple Ruby <a href="http://wakoopa.com/">Wakoopa</a> API wrapper. It's built to give an ActiveRecord-like way to fetch your software usage data.
The <a href="http://github.com/jeffkreeftmeijer/wakoopa/">source is on github</a>, there's a pretty good <a href="http://wiki.github.com/jeffkreeftmeijer/wakoopa/">wiki</a> and the <a href="http://gemcutter.org/gems/wakoopa/">gem is on gemcutter</a>. If you run into any issues, please <a href="http://github.com/jeffkreeftmeijer/wakoopa/issues/">report</a>.
require 'navvy'
require 'navvy/job/data_mapper'
DataMapper.setup(:default, "sqlite3://your_database.sqlite")
Navvy::Job.auto_migrate!