Skip to content

Instantly share code, notes, and snippets.

View timfel's full-sized avatar

Tim Felgentreff timfel

View GitHub Profile
~...s/rsoc/rails_test ✔ jruby -S gem install mongrel-1.1.5.gem sqlite3-ruby
Building native extensions. This could take a while...
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.7
Successfully installed cgi_multipart_eof_fix-2.5.0
Successfully installed mongrel-1.1.5
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.3.1
~...s/rsoc/rails_test ✔ grep -m2 -C1 sqlite3 config/database.yml
# SQLite version 3.x
bin/jruby jruby-cext/examples/MyTest/MyTest.rb
@timfel
timfel / ruby_syntax_checker.rb
Created October 21, 2010 23:52
Simple Syntax checking for Ruby in Redcar?
require 'java'
module Java::IO
import 'java.io.File'
import 'java.io.FileInputStream'
end
module JRuby
import 'org.jruby.Ruby'
end
Error in command Redcar::WebBookmarks::ShowTree
TypeError: cannot convert instance of class org.jruby.RubySymbol to class [Ljava.lang.Object;
/Users/tim/Devel/projects/redcar/plugins/tree_view_swt/lib/tree_view_swt.rb:32:in `initialize'
/Users/tim/Devel/projects/redcar/plugins/application_swt/lib/application_swt/treebook.rb:24:in `new'
/Users/tim/Devel/projects/redcar/plugins/application_swt/lib/application_swt/treebook.rb:24:in `tree_added'
/Users/tim/Devel/projects/redcar/plugins/application_swt/lib/application_swt/treebook.rb:16:in `to_proc'
/Users/tim/Devel/projects/redcar/plugins/core/lib/core/observable.rb:103:in `call'
/Users/tim/Devel/projects/redcar/plugins/core/lib/core/observable.rb:103:in `observable_run_blocks'
/Users/tim/Devel/projects/redcar/plugins/core/lib/core/observable.rb:103:in `map'
/Users/tim/Devel/projects/redcar/plugins/core/lib/core/observable.rb:103:in `observable_run_blocks'

Building MLVM version of OpenJDK (Java 1.7) on Mac OS X

Take a look at the comments and code in update.sh.

I use update-usr-local.sh after a successful build to copy the new JVM into /usr/local.

I add pickjdk.sh into my ~/.bash_profile to allow easy switching between multiple JVMs.

I use create_tarball.sh to make a copy of the build to share.

@timfel
timfel / svn-to-git.sh
Created October 29, 2010 10:35
Simple script to convert svn subtrees to git from a git-svn repo (with all branches)
function filter_git_repo ()
{
cd ../../GitRepos/$1;
git filter-branch --subdirectory-filter $1 -- --all;
cd ../../reporting_branch/cockpit/
}
function push_git_repo ()
{
git push $1 --all
@timfel
timfel / export.st
Created January 13, 2011 13:03
category fileout squeak
fileOutCategory := [:aCategory || subfolder |
"This creates a sub-folder in the repository for the categories classes"
subfolder := (aCategory asString findBetweenSubStrs: '-') last.
(self package packageClasses intersection: (systemOrganizer superclassOrder: aCategory)) ifNotEmptyDo: [:arr |
self createFolder: ((File path: subfolder) exists
ifFalse: [repoDir createDirectory: subfolder]).
arr do: [:aClass || aStream aFile |
aStream := WriteStream on: (String new: 100).
aClass
fileOutOn: stream
@timfel
timfel / .rvmrc
Created January 17, 2011 19:55 — forked from jc00ke/.rvmrc
rvm --create --use maglev-24990@my_gemset
ruby update.rb
#!/bin/bash
### BEGIN INIT INFO
# Provides: APPLICATION
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable APPLICATION at boot time.
### END INIT INFO
Thread.start do
x = 1
eval("self.class.class_eval { define_method(:action) { x } }")
end.join
action # => 1