Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'rubygems'
require 'basic_daemon'
basedir = "/tmp"
d = BasicDaemon.new
# for restarts to work properly, you can't use anonymous blocks. In other
#!/usr/bin/env ruby
require 'rubygems'
require 'basic_daemon'
class MyDaemon < BasicDaemon
def run
foo = open("/tmp/out", "w")
i = 1
@samullen
samullen / blueprints.rb
Created January 28, 2010 14:56
Testing MongoMapper with Machinist
require 'machinist/mongomapper'
require 'sham'
require 'faker'
Sham.define do
username { Faker::Internet.user_name }
email { Faker::Internet.email }
# confirmed_at { ...date... }
# confirmation_sent_at { ...date... }
# remember_token { 'Cj4ja2A3Xp6MEK6rdUej' }
#!/usr/bin/env ruby
require 'rb-inotify'
notifier = INotify::Notifier.new
notifier.watch("/path/to/watch", :moved_to, :create) do |event|
puts "I found #{event.name}!"
end
notifier.run