Skip to content

Instantly share code, notes, and snippets.

@cadwallion
cadwallion / ball.rb
Created December 17, 2011 14:35
Peter Cooper's jRuby Pong, Refactored
require 'java'
require 'lwjgl.jar'
require 'slick.jar'
java_import org.newdawn.slick.Image
require 'pong/image_context'
require 'pong/collidable_attributes'
module Pong
@headius
headius / gist:1319127
Created October 27, 2011 09:17
JRuby master configuration properties.
These properties can be used to alter runtime behavior for perf or compatibility.
Specify them by passing -X<property>=<value>
or if passing directly to Java, -Djruby.<property>=<value>
or put <property>=<value> in .jrubyrc
compiler settings:
compile.mode=[JIT, FORCE, OFF]
Set compilation mode. JIT = at runtime; FORCE = before execution. Default is JIT.
compile.dump=[true, false]
@textarcana
textarcana / git-log2json.sh
Last active January 24, 2025 22:12
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'