Skip to content

Instantly share code, notes, and snippets.

Charles Oliver Nutter headius

Block or report user

Report or block headius

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View runner.rb
#!/usr/bin/env jruby
require 'rubygems'
require 'fileutils'
require 'optparse'
ENV['RAILS_ENV'] = "development"
launcher, options = "jruby", ""
OptionParser.new do |opt|
opt.banner = "Usage: runner [OPTIONS]"
@nateberkopec
nateberkopec / gist:11dbcf0ee7f2c08450ea
Last active Sep 17, 2018
RubySpec is dead, long live RubySpec!
View gist:11dbcf0ee7f2c08450ea

Last night, Brian Shirai unilaterally "ended" the RubySpec project, a sub-project of Rubinius (the alternative Ruby implementation which Brian was paid to work on full-time from 2007 to 2013). The blog post describing his reasons for "ending" the project led to a big discussion on Hacker News.

When a single, competing Ruby implementation tells that you its test suite is the One True Way, you should be skeptical. Charles Nutter, Ruby core committer and JRuby head honcho, spent a lot of time last night on Twitter talking to people about what this decision means. He's probably too busy and certainly too nice of a guy to write about what is a political issue in the Ruby community, so I'm going to do it on behalf of all the new or intermediate Rubyists out there that are confused by Brian's decision and what it me

View gist:8673710
[subbu@earth ir] cat !$
cat ~/bin/runspecs
#!/bin/sh
if [ $1 ]
then
echo "Running all specs with passes $1"
jruby -J-ea -X-CIR -Xir.passes=$1 -J-Djruby.launch.inproc=true -S spec/mspec/bin/mspec ci -B spec/jruby.1.9.spec -V -T -J-Djruby.compile.mode=OFFIR -T -J-Djruby.ir.passes=$1
else
echo "Running all specs with default passes"
@headius
headius / ffi-jep.md
Last active Jan 26, 2016
JDK Enhancement Proposal: FFI
View ffi-jep.md

Title: Foreign Function Interface Author: Charles Oliver Nutter Organization: Red Hat Owner: Charles Oliver Nutter Created: 2014/01/28 Type: Feature State: Draft Exposure: Open Component: --/-- Scope: JDK

@headius
headius / fiber_fix.rb
Created Nov 1, 2011
Workaround for broken 'fiber' library load on 1.6.5
View fiber_fix.rb
# I merged across a change in the package name for FiberExtLibrary but did
# not merge across a subsequent change to load the library from that package.
# The following change loads the extension associated with the 'fiber'
# library directly.
# If you are using the 'fiber' library, rescue that require with this code.
# My apologies on such a stupid regression :)
require 'jruby'
@headius
headius / gist:1234935
Created Sep 22, 2011
OS X 'pickjdk' command with single-command selection and updated JDK location
View gist:1234935
#!/bin/bash
#
# Provides a function that allows you to choose a JDK. Just set the environment
# variable JDKS_ROOT to the directory containing multiple versions of the JDK
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned
# up and set appropriately.
_macosx()
{
if [ $(uname -s) = Darwin ]; then
@headius
headius / build.sh
Created Aug 16, 2011
Building the Hotspot compiler team's Hotspot branch alone
View build.sh
#!/bin/sh
# This script is for building the hsx/hotspot-comp branch in isolation.
#
# Prerequisites:
# * appropriate build tools
# * a working Sun Java 6 build (i.e. JDK6) is available at:
# HOME/java/re/j2se/1.6.0/latest/binaries/linux-[i586/amd64]
# * a working Sun Java 7 build (i.e. JDK7) is available at:
# HOME/java/re/j2se/1.7.0/latest/binaries/linux-[i586/amd64]
# HOME/java/re/j2se/1.7.0/promoted/latest/binaries/linux-[i586/amd64]
View gist:882550
require 'stringio'
require 'base64'
def read_varint(io)
value = index = 0
begin
byte = io.readchar
value |= (byte & 0x7f) << (7 * index)
index += 1
end while (byte & 0x80).nonzero?
View gist:819370
~/projects/jrubies ➔ ls
jruby-0.5.2 jruby-0.8.1 jruby-0.9.1 jruby-0_3_0 jruby-1.0 jruby-1.1 jruby-1.1.4 jruby-1.3.0 jruby-1.5.0 jruby-1.5.4 jruby-1.6.0.RC2
jruby-0.5.3 jruby-0.8.2 jruby-0.9.8 jruby-0_3_1 jruby-1.0.1 jruby-1.1.1 jruby-1.1.5 jruby-1.3.1 jruby-1.5.1 jruby-1.5.5 jruby_0_2_0
jruby-0.7.0 jruby-0.8.3 jruby-0.9.9 jruby-0_5_0 jruby-1.0.2 jruby-1.1.2 jruby-1.1.6 jruby-1.4.0 jruby-1.5.2 jruby-1.5.6 jruby_0_2_1
jruby-0.8.0 jruby-0.9.0 jruby-0_2_4 jruby-0_5_1 jruby-1.0.3 jruby-1.1.3 jruby-1.2.0 jruby-1.4.1 jruby-1.5.3 jruby-1.6.0.RC1 jruby_0_2_2
~/projects/jrubies ➔ time java -jar jruby_0_2_0/jruby.jar -e "def fib(a); a < 2 ? a : fib(a - 1) + fib(a - 2); end; 10.times { fib(30) }"
real 0m52.106s
user 0m49.630s
View giver
~/projects/jcd ➔ ab -n 1000 -d -S http://localhost:3000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
You can’t perform that action at this time.