Skip to content

Instantly share code, notes, and snippets.

View jumph4x's full-sized avatar

Denis Ivanov jumph4x

  • FCP Euro
  • Oakland
View GitHub Profile
@tomlea
tomlea / gist:207938
Created October 11, 2009 22:55
This is very rough and ready.
require "net/http"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
#
@tansengming
tansengming / Rails Console Actionmailer test.rb
Created April 24, 2009 15:14
Rails Console Actionmailer test
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
@recipients = "someone@somewhere.com"
@from = "must_be_same_as_smpt_account_login@gmail.com"
@subject = "test from the Rails Console"
@body = "This is a test email"
end
end
@ggonnella
ggonnella / mysql_DB_clone.rake
Created April 21, 2009 08:47
MySQL rake task for rails to copy the content of the production database to the development database. Please note that the current development database will be DROPPED!
namespace :db do
namespace :mysql do
desc "Overwrite the whole development db with a copy of the production db"
task :init_dev do
config = YAML.load(IO.read("config/database.yml"))
d = config["development"]
p = config["production"]
unless d["adapter"] == "mysql" and