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
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |
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
DS.ExpandableRecordArray = DS.RecordArray.extend | |
isLoading: false | |
load: (array) -> | |
@set 'isLoading', true | |
self = this | |
observer = -> | |
if @get 'isLoaded' | |
content = self.get 'content' |
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
gem "actionpack" | |
gem "thin" |
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
gem "actionpack" |
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
source "http://rubygems.org" | |
gem "webmachine" | |
gem "actionpack" | |
gem "thin" | |
gem "datamapper" | |
gem "dm-migrations" | |
gem "dm-sqlite-adapter" | |
gem "debugger" |
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
source "http://rubygems.org" | |
gem "webmachine" | |
gem "actionpack" | |
gem "thin" | |
gem "datamapper" | |
gem "dm-migrations" | |
gem "dm-sqlite-adapter" | |
gem "debugger" |
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
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
# We are not loading Active Record, nor the Assets Pipeline, etc. | |
# This could also be in your Gemfile. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
# The following lines should come as no surprise. Except by |
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
#!/bin/bash | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
gem install linecache19-0.5.13.gem | |
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include="${MY_RUBY_HOME/rubies/src}" | |
gem install ruby-debug19 | |
rm ruby-debug-base19-0.11.26.gem | |
rm linecache19-0.5.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
CREATE OR REPLACE FUNCTION array_array_agg_sfunc(state integer[][], p integer[]) RETURNS integer[][] AS $$ | |
BEGIN | |
IF p IS NULL THEN | |
RETURN state; | |
END IF; | |
IF array_dims(state) IS NULL THEN | |
RETURN ARRAY[p]; | |
END IF; | |
RETURN array_cat(state, p); | |
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
# This example fetches accounts of my 10 followers using Github's API | |
# One version uses Connection: keep-alive, the other one uses Connection: close | |
require 'net/https' | |
require 'uri' | |
require 'json' | |
require 'benchmark' | |
def request(uri, persistent = true) | |
req = Net::HTTP::Get.new uri |