Skip to content

Instantly share code, notes, and snippets.

View jeffkreeftmeijer's full-sized avatar
🦞

Jeff Kreeftmeijer jeffkreeftmeijer

🦞
View GitHub Profile
# Option 1
info = if publication
"Title: #{ publication.title } (ID: #{ publication.id })"
else
'N/A'
end
# Option 2
info = case publication
when Publication then puts "Title: #{ publication.title } (ID: #{ publication.id })"
@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(' '))
class Tosti
def self.validate(*ingredients, preparation_method)
ingredients.include?(:brood) && ingredients.length > 1 && preparation_method == :grill
end
end
class Tosti
def self.validate(*ingredients, preparation_method)
ingredients.include?(:brood) && ingredients.length > 1 && preparation_method == :grill
end
end
require 'rubygems'
require 'httparty'
loop do
response = HTTParty.get 'http://store.apple.com/'
if response.body.include? "We'll be back soon"
puts '.'
else
`say OMG! It\\'s back!`
end
require 'rubygems'
require 'mechanize'
require 'httparty'
# Ugly code, for an ugly hack.
# Hey, if Lighthouse didn't suck then none of this would happen.
# It's been lotsa fun coding it though, so I suppose I should be thankful for the "opportunity"
require 'rubygems'
require 'mechanize'
require 'httparty'
# Ugly code, for an ugly hack.
# Hey, if Lighthouse didn't suck then none of this would happen.
# It's been lotsa fun coding it though, so I suppose I should be thankful for the "opportunity"