Skip to content

Instantly share code, notes, and snippets.

require 'right_http_connection'
require 'tempfile'
c = Rightscale::HttpConnection.new
f = Tempfile.new('foo')
url = URI.parse('http://example.com/my/big/file')
while data = c.request(:server => url.host, :port => 80, :protocol => 'http', :request => Net::HTTP::Get.new(url.path)).body.read(1024)
f.write(data)
class nginx {
include monit
package { nginx:
ensure => "installed"
}
service { nginx:
enable => true,
ensure => "running",
→ irb
>> Time.parse('tomorrow at 8pm')
NoMethodError: undefined method `parse' for Time:Class
from (irb):1
>> require 'active_support'
=> true
>> Time.parse('tomorrow at 8pm')
=> Thu Dec 11 20:00:00 -0800 2008
>>
SwappableFields = Class.create({
initialize: function() {
$$('.swappable').each(this.makeSwappable);
},
makeSwappable: function(element) {
var obj = this;
element.observe('click', this.swap.bind(obj));
>> stuff = %Q(<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=221785&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=221785&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><br /><a href="http://vimeo.com/221785">"Riding for a Living" - by Nitro Snowboards</a> from <a href="http://vimeo.com/nitrosnow">Nitro Snowboards</a> on <a href="http://vimeo.com">Vimeo</a>)
=> "<object width=\"400\" height=\"300\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=221785
--- src/http/ngx_http_upstream.c 2009-01-09 11:37:58.000000000 -0800
+++ src/http/ngx_http_upstream.c 2009-01-09 12:03:18.000000000 -0800
@@ -1036,8 +1036,8 @@
{
ssize_t n;
ngx_int_t rc;
- ngx_str_t *uri, args;
- ngx_uint_t i, flags;
+ ngx_str_t *uri, args, *hs;
+ ngx_uint_t i, j, flags;
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
/opt/local/etc/macports/sources.conf
# MacPorts system wide sources configuration file
# $Id: sources.conf 26177 2007-06-15 10:11:22Z jmpp@macports.org $
#
# To enable your local ports repository, uncomment and customize the
# following line to point at your local ports directory
# Example: file:///Users/landonf/misc/MacPorts/ports
#
# To prevent a source from synchronizing when `port sync` is used,
---
:update_sources: true
:bulk_threshold: 1000
:sources:
- http://gems.rubyforge.org/
- http://gems.github.com/
:verbose: true
:benchmark: false
:backtrace: false
gem: --no-rdoc --no-ri
development:
adapter: mysql
database: macchiato_development
username: root
password:
host: localhost
encoding: utf8
socket: /opt/local/var/run/mysql5/mysqld.sock
test: