Skip to content

Instantly share code, notes, and snippets.

View kuntoaji's full-sized avatar
🎯
Focusing

KAK kuntoaji

🎯
Focusing
View GitHub Profile
@rrichards
rrichards / rhino_template.rb
Created April 7, 2009 23:47
rails template for skeleton app, haml, sass, shoulda, factory_girl, jquery
# Set up git repository
git :init
# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"
# Set up .gitignore files
run %{find . -type d -empty | xargs -I xxx touch xxx/.gitignore}
file '.gitignore', <<-END
.DS_Store
@woodie
woodie / Gemfile .rb
Created November 12, 2009 09:18
Rails 3.0.pre GAE Guide
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path ".gems/bundler_gems"
# List gems to bundle here:
gem "rails", "3.0.pre", :git => "git://github.com/rails/rails.git"
gem "arel", :git => "git://github.com/rails/arel.git"
gem "i18n"
gem "dm-appengine"
#!/usr/bin/env ruby
# urlmonitor - print out the URLs requested system wide on the main network interface
# Accept a network interface name as an optional argument
iface = ARGV.first
# No interface specified? Try to guess which one is king..
unless iface
`ifconfig -l`.split.each do |iface|
next if iface =~ /^lo/
@woodie
woodie / README.rdoc
Created January 5, 2010 02:04
Rails 2.3.10 on App Engine with TinyDS

Rails 2.3.10 on App Engine (TinyDS)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the DataMapper version also: gist.github.com/671792

Install the Development Environment

@woodie
woodie / Gemfile .rb
Created February 23, 2010 18:31
ActionMailer JavaMail on AppEngine
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path '.gems/bundler_gems'
# List gems to bundle here:
gem 'jruby-openssl', '0.5.2'
gem 'rails', "2.3.5"
gem 'rails_dm_datastore', "0.2.5"
gem "actionmailer-javamail", :require_as => "java_mail"
@karmi
karmi / application.rb
Created March 3, 2010 11:37
Using Sinatra with Rack::Auth::Basic and Rack::Cache
require 'rubygems'
require 'sinatra/base'
require 'rack/cache'
gem 'sinatra', '~> 1' # Require Sinatra version 1.x
class Application < Sinatra::Base
use Rack::Auth::Basic do |username, password|
[username, password] == ['admin', 'admin']
@smichaelis
smichaelis / Gemfile
Created May 4, 2010 11:34
Steps to get Devise Authentication and CanCan Authorization running on Ruby on Rails 2.3.5 with DataMapper and Bundler on Google AppEngine
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path '.gems/bundler_gems'
# List gems to bundle here:
gem 'rails_dm_datastore'
gem 'rails', "2.3.5"
# Needed for Devise-Plugin

Rails 3.0.pre on App Engine

You can Rails 3 on App Engine, but it won’t be especially useful until bundler 10. You should try these instead:

Install the Development Environment

The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.

#!/usr/bin/env ruby
comp_line = ENV["COMP_LINE"]
exit -1 if comp_line.nil?
COMMANDS = %w(server generate destroy plugin benchmarker profiler
console dbconsole application runner)
parts = comp_line.scan(/\w+/)
exit 0 unless parts.size == 2
@woodie
woodie / README.rdoc
Created September 5, 2010 12:29
Rails 2.3.9 on App Engine with DataMapper

Rails 2.3.9 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment