Skip to content

Instantly share code, notes, and snippets.

View mwhuss's full-sized avatar

Marshall Huss mwhuss

View GitHub Profile
ssh-copy-id -i ~/.ssh/id_rsa.pub <user>@remotehost
git push origin master:refs/heads/production
git checkout --track -b production origin/production
From a533eba6556483936d2cf52d633f1ac484b7a12f Mon Sep 17 00:00:00 2001
From: Marshall Huss <mwhuss@gmail.com>
Date: Mon, 18 May 2009 18:34:44 -0400
Subject: [PATCH] Added some more tests for proxy support
---
activeresource/lib/active_resource/base.rb | 22 ++++++++
activeresource/lib/active_resource/connection.rb | 12 ++++-
activeresource/test/base_test.rb | 64 ++++++++++++++++++++++
activeresource/test/connection_test.rb | 10 ++++
# If your Active Resource object is required to use an HTTP Proxy you can set the +proxy+ value which hold a URI.
#
# class PersonResource < ActiveResource::Base
# self.site = "http://api.people.com:3000/"
# self.proxy = "http://user:password@proxy.people.com:8080"
# end
class PersonResource < ActiveResource::Base
self.site = "http://api.people.com:3000/"
self.proxy = "http://user:password@proxy.people.com:8080"
end
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema;
use Rack::Static, :urls => ["/stylesheets", "/images"], :root => "public"
run lambda { |env| [200, { 'Content-Type' => 'text/html', 'Cache-Control' => 'public, max-age=86400' }, File.open('public/index.html', File::RDONLY)] }
- MySite
|-config.ru
|-public
|-index.html
|-stylesheets
|-images
$ curl -I http://nezumiapp.com/
HTTP/1.1 200 OK
Server: nginx/0.6.39
Date: Mon, 14 Dec 2009 02:30:04 GMT
Content-Type: text/html
Connection: keep-alive
Cache-Control: public, max-age=86400
Content-Length: 1591
X-Varnish: 360981972 358026896
Age: 75083
class Numeric
def neg
self.abs * -1
end
end
puts 5.neg # => -5