Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile

Rails 2.3.5 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.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TinyDS version also: gist.github.com/269075

Install the Development Environment

<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function(){
jQuery.noConflict();
var jq = jQuery;
jq.ajax({
url: '/rss',
type: 'GET',
dataType: 'xml',
error: function (xhr, status, e) {
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'digest/md5'
require 'fastercsv'
require 'json'
require 'curb'
require 'pp'
data = []
#!/bin/sh
curl -H "Content-Type: application/json" -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:password@127.0.0.1:5984/couchappspora","target":"http://glitterbacon.couchone.com/couchappspora","continuous":true}'
curl -H "Content-Type: application/json" -X POST http://127.0.0.1:5984/_replicate -d '{"target":"http://admin:password@127.0.0.1:5984/couchappspora","source":"http://glitterbacon.couchone.com/couchappspora","continuous":true}'
curl -H "Content-Type: application/json" -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:password@127.0.0.1:5984/couchappspora","target":"http://victusfate.couchone.com/couchappspora","continuous":true}'
curl -H "Content-Type: application/json" -X POST http://127.0.0.1:5984/_replicate -d '{"target":"http://admin:password@127.0.0.1:5984/couchappspora","source":"http://victusfate.couchone.com/couchappspora","continuous":true}'
#curl -H "Content-Type: application/json" -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://ad
<!DOCTYPE HTML>
<html>
<head>
<style>
button {
display: inline-block;
outline: none;
cursor: pointer;
@victusfate
victusfate / webapp.rb
Created November 16, 2010 20:45 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@victusfate
victusfate / webapp.py
Created November 16, 2010 20:51 — forked from alex/webapp.py
import traceback
class WebApp(object):
def __init__(self, obj):
self.obj = obj
def __call__(self, environ, start_response):
try:
path = filter(bool, environ["PATH_INFO"].split("/"))
@victusfate
victusfate / webapp.js
Created November 16, 2010 20:52 — forked from visnup/README.js
var connect = require('connect')
, sys = require('sys');
var webapp = function(req, res) {
var path = req.url.split('/');
this[path[1]].apply(this, path.slice(2));
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(sys.inspect(this));
};
require 'net/http'
require 'uri'
require 'nokogiri'
url = URI.parse('http://webapps.cityofchicago.org/healthinspection/inspectionresultrow.jsp')
request = Net::HTTP::Post.new(url.path)
request.set_form_data({"REST"=>" ", "STR_NBR"=>"", "STR_NBR2"=>"", "STR_DIRECTION"=>"", "STR_NM"=>"", "ZIP"=>""})