Skip to content

Instantly share code, notes, and snippets.

class ParamsParser
def initialize(app, &condition)
@app = app
@condition = condition
end
def call(env)
request = Rack::Request.new(env)
signed_request = request.params["signed_request"]
@oleriesenberg
oleriesenberg / 0-readme.md
Created October 13, 2012 13:59 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

var Deeplinking = function() {
var deeplink_map = {};
function initialize(map) {
deeplink_map = map;
$(document).ready(function() {
var query = jQuery.parseQuery();
for (queryKey in deeplink_map) {
def determine_mime_type(io)
blob = io.read(10)
return 'image/gif' if blob.match(/^GIF8/)
return 'image/png' if blob.match(/^\x89PNG/)
return 'image/jpeg' if blob.match(/^\xff\xd8\xff\xe0\x00\x10JFIF/)
return 'image/jpeg' if blob.match(/^\xff\xd8\xff\xe1(.*){2}Exif/)
'unknown'
end
;; QUESTION SECTION:
;production.cf.rubygems.org. IN A
;; ANSWER SECTION:
production.cf.rubygems.org. 1474 IN CNAME d2chzxaqi4y7f8.cloudfront.net.
d2chzxaqi4y7f8.cloudfront.net. 60 IN A 216.137.59.202
d2chzxaqi4y7f8.cloudfront.net. 60 IN A 216.137.59.109
d2chzxaqi4y7f8.cloudfront.net. 60 IN A 216.137.59.95
d2chzxaqi4y7f8.cloudfront.net. 60 IN A 216.137.59.14
d2chzxaqi4y7f8.cloudfront.net. 60 IN A 216.137.59.203
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<title>G&#228;stehaus Zitt</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Abstract" content="G&#228;stezimmer mit allem Komfort in Oy-Mittelberg im Allg&#228;u.">
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
>> api = BitlyApi::Bitly.new(:login => BITLY_LOGIN, :api_key => BITLY_API_KEY)
=> #<BitlyApi::Bitly:0x7f93177c87e0 @api_version="2.0.1", @api_key=BITLY_API_KEY, @login=BITLY_LOGIN>
>> api.shorten "http://pickhost.eu"
=> {"userHash"=>"2wzb4d", "hash"=>"zNgN6", "shortKeywordUrl"=>"", "shortUrl"=>"http://bit.ly/2wzb4d"}
>> api.expand "2wzb4d"
=> {"longUrl"=>"http://pickhost.eu/"}
>> api.stats "2wzb4d"
=> {"userClicks"=>1, "referrers"=>{""=>{"direct"=>1}}, "userHash"=>"2wzb4d", "hash"=>"zNgN6", "clicks"=>1, "userReferrers"=>{""=>{"direct"=>1}}}
>> api.info "2wzb4d"
=> {"thumbnail"=>{"small"=>"http://s.bit.ly/bitly/zNgN6/thumbnail_small.png", "medium"=>"http://s.bit.ly/bitly/zNgN6/thumbnail_medium.png", "large"=>"http://s.bit.ly/bitly/zNgN6/thumbnail_large.png"}, "id3"=>{}, "userHash"=>"2wzb4d", "hash"=>"zNgN6", "mirrorUrl"=>"", "htmlMetaDescription"=>"An image hosting service with simplicity and speed in mind.", "version"=>1.0, "htmlTitle"=>"Pic(k)host :: Upload your Images!", "globalHash"=>"zNgN6", "calaisId"=>"