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 shows how to setup an environment running Rails 3 beta under 1.9.2-head with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) or do 'rvm reload' | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install 1.9.2-head | |
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist. | |
∴ rvm --create use 1.9.2-head@rails3 |
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
# checkout: http://github.com/igrigorik/async-rails/ | |
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
From: Ilya Grigorik <[email protected]> | |
Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
Subject: [PATCH] async rails3 | |
--- | |
Gemfile | 6 ++++++ | |
app/controllers/widgets_controller.rb | 6 ++++++ |
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
diff --git a/lib/integrity/builder.rb b/lib/integrity/builder.rb | |
index 6968d9e..691ff70 100644 | |
--- a/lib/integrity/builder.rb | |
+++ b/lib/integrity/builder.rb | |
@@ -46,7 +46,8 @@ module Integrity | |
end | |
def run | |
- cmd = "(cd #{repo.directory} && #{@build.project.command} 2>&1)" | |
+ cmd = "(cd #{repo.directory} && RUBYOPT=#{pre_bundler_rubyopt} PATH=#{pre_bundler_path} && #{@build.project.command} 2>&1)" |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-websocket' | |
require 'json' | |
class Connection | |
attr_accessor :socket, :user_id | |
def initialize(socket, user_id) | |
@socket = socket |
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
#!/usr/bin/env ruby | |
require 'benchmark' | |
require 'rubygems' | |
require 'nokogiri' | |
require 'yajl' | |
require 'active_support' | |
ActiveSupport::XmlMini.backend='Nokogiri' | |
require 'active_resource' |
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
# http://snippets.aktagon.com/snippets/445-How-to-create-a-JSONP-cross-domain-webservice-with-Sinatra-and-Ruby | |
require 'sinatra/base' | |
require 'json/pure' | |
module JSONPatra | |
class App < Sinatra::Base | |
get "/" do | |
callback = params['callback'] | |
json = { :hello => "world!" }.to_json |
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
class SampleApp < Padrino::Application | |
register Padrino::Warden | |
Warden::Strategies.add(:password) do | |
def valid? | |
params["email"] || params["password"] | |
end | |
def authenticate! | |
u = Account.authenticate(params["email"], params["password"]) |
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 a simple top to bottom linear gradient with a background-color backup | |
// The first argument, $color will be output as background-color: $color | |
// | |
// This yields a gradient that is 5% brighter on the top and 5% darker on the bottom | |
// | |
// +gradient-bg(#777) | |
// | |
// This yeilds a gradient where the bright and dark colors are shifted 10% from the original color. | |
// If you don't specify a third argument it will assign this value for the darkness too, keeping the gradient even. | |
// |
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
# | |
# Wind Wordpress Importer | |
# | |
# To install this plugin do you need copy the file to Wind plugins directory. | |
# An admin widget will be crated to import WordPress eXtended RSS file. | |
# | |
# This plugin use hurricane gem [http://github.com/danieltamiosso/hurricane], | |
# [gem install hurricane] to install it. | |
# |
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
mkdir wpgskeeter | |
cd wpgskeeter | |
git init | |
heroku create wpgskeeter | |
git add . | |
git commit -m 'Initial commit' | |
Create a .gems file: | |
sinatra | |
nokogiri |