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
require 'postie' | |
use Postie::Application |
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
require File.join(File.dirname(__FILE__), 'boot') | |
Rails::Initializer.run do |config| | |
config.gem 'postie', :lib => 'postie' | |
config.middleware.use 'Postie::Application' | |
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
module Locality::Search | |
def self.included(base) | |
base.class_eval do | |
class << self | |
def search(criteria) | |
logger.debug("search") | |
results = find_all_by_name(criteria) | |
if results.empty? |
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
# Usage | |
require 'hookr' | |
class A | |
include Hookr | |
def b | |
puts "bee" | |
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
# The only working install (on mac) I can get to run of libmemcached and e.weaver's memcached gem | |
wget http://blog.evanweaver.com/files/libmemcached-0.25.14.tar.gz | |
tar -xzvf libmemcached-0.25.14.tar.gz | |
cd libmemcached-0.25.14 | |
./configure && make && make install | |
wget http://blog.evanweaver.com/files/memcached-0.13.gem | |
sudo gem install memcached-0.13.gem |
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
// Found on my desktop from early 07' | |
// JSON ActiveResource - REST Implementation | |
/* | |
Example of use. | |
new Model('User'); | |
var myUser = User.find(12); | |
myUser.name = 'Benjamin'; | |
myUser.save; |
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
# Download images from ffffound and add to random desktop images. | |
# Install: | |
# Add to cron | |
# Create "FFFFound" directory in ~/Pictures/ | |
# Happiness ensues | |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' |
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
# Rails app generator | |
# Remove unnecessary Rails files | |
run 'rm README' | |
run 'rm public/index.html' | |
run 'rm public/favicon.ico' | |
run 'rm public/images/rails.png' | |
# Copy database.yml | |
run 'cp config/database.yml config/database.yml.example' |
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
FakeWeb.register_uri(:get, %r(google(.*)geo), :response => File.join(SPEC_ROOT, 'support', 'fakeweb', 'geo')) unless FakeWeb.registered_uri?(:get, "http://maps.google.com/geo") |
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
>> require 'moneta/memcache' | |
=> true | |
>> Moneta::Memcache | |
=> Moneta::Memcache | |
>> m = Moneta::Memcache.new :server => "127.0.0.1:11211" | |
NameError: uninitialized constant Moneta::Memcache::MemCache | |
from /Library/Ruby/Gems/1.8/gems/moneta-0.6.0/lib/moneta/memcache.rb:15:in `initialize' | |
from (irb):4:in `new' | |
from (irb):4 |