Skip to content

Instantly share code, notes, and snippets.

View woodie's full-sized avatar

John Woodell woodie

View GitHub Profile
@woodie
woodie / request.mirah
Created July 15, 2010 22:07 — forked from ribrdb/request.mirah
ribrdb params object
import java.util.HashMap
import java.util.Map
class Params
def initialize(request:HttpServletRequest)
@request = request
@params = HashMap.new
end
def get(name:String)
import java.io.IOException
import javax.servlet.http.HttpServlet
import com.google.apphosting.api.ApiProxy
import com.google.apphosting.api.ApiProxy.Environment
class Plain < HttpServlet
def doGet(req:HttpServletRequest, resp:HttpServletResponse); throws IOException
env = ApiProxy.getCurrentEnvironment
raw_ver = env.getVersionId
version = raw_ver.substring 0, raw_ver.lastIndexOf(".")
@woodie
woodie / openid_fetch_fix.rb
Created March 10, 2010 00:32
OpenID Example
require 'openid'
require 'net/http'
require 'appengine-apis/urlfetch'
class MyFetcher < OpenID::StandardFetcher
def fetch(url, body=nil, headers=nil, redirect_limit=REDIRECT_LIMIT)
raise OpenID::FetchingError, "Blank URL: #{url}" if url.blank?
headers ||= {}
headers['User-agent'] ||= USER_AGENT
diff --git a/src/org/jruby/compiler/JITCompiler.java b/src/org/jruby/compiler/JITCompiler.java
index c1bc58a..3fb2faa 100644
--- a/src/org/jruby/compiler/JITCompiler.java
+++ b/src/org/jruby/compiler/JITCompiler.java
@@ -190,6 +190,7 @@ public class JITCompiler implements JITCompilerMBean {
private String className;
private String filename;
private String methodName;
+ private String key;
@woodie
woodie / appengine gem versions
Created January 18, 2010 23:35 — forked from takeru/appengine gem versions
Gem Versions and Dates
require "date"
puts "appengine gem versions: #{Time.now}"
cmd = "gem list | grep appengine"
#puts cmd
gems = `#{cmd}`.split("\n").collect{|v| v.strip }.sort
gems.each do |gem|
if gem =~ /^(\S+) \((.+)\)$/
name = $1
versions = $2.split(",").collect{|v| v.strip }.sort
@woodie
woodie / gist:280490
Created January 18, 2010 23:27 — forked from headius/gist:280301
CodeCache = Awesomeness
~/projects/jruby ➔ jruby -J-Djruby.jit.threshold=0 -J-Djruby.jit.codeCache=`pwd`/codecache -e "load 'test/mri/sample/test.rb'"
assignment : ..................................................................................................................................................................................................................................................................................................................................................................condition : ..if/unless : ...case : .....while/until : ........exception : .......array : .......................................hash : ...........................iterator : .........................................................................................float : ................................................................................bignum : ...............................string & char : ..............................................................assignment : ..........call : ......proc : .........eval : ..
@woodie
woodie / redo.duby
Created January 13, 2010 23:20 — forked from ribrdb/redo.duby
def foo(a:int[])
a.each {|x| x += 1;puts x; redo if x == 2}
end