Skip to content

Instantly share code, notes, and snippets.

View nicksieger's full-sized avatar

Nick Sieger nicksieger

View GitHub Profile
@nicksieger
nicksieger / jruby.sh
Created March 15, 2012 16:20
JRuby launcher script to use in Warbler war files
#!/bin/sh
#
# Simple script to launch JRuby using the components embedded in a war created by Warbler.
# Tell Warbler to put this script in /WEB-INF with this config/warble.rb code:
#
# config.webinf_files += FileList["jruby.sh"]
#
HERE=`dirname $0`
GEM_HOME=$HERE/gems
@nicksieger
nicksieger / .gitignore
Created February 23, 2012 23:46
Some clojure examples
/Gemfile.lock
@nicksieger
nicksieger / chess.rb
Created February 23, 2012 22:16 — forked from daveray/chess.rb
Joy of Clojure Chess Example in Familiar/JRuby
# Rough translation from Joy of Clojure refs example in Familiar
# https://github.com/daveray/familiar
# https://github.com/joyofclojure/book-source/blob/master/src/joy/refs.clj
$initial_board = [[:o, :k, :o],
[:o, :o, :o],
[:o, :K, :o]].to_clojure
# (defn board-map [f bd]
# (vec (map #(vec (for [s %] (f s))) bd)))
@nicksieger
nicksieger / .gitignore
Created February 2, 2012 19:27
Reverting 84e3e3fe makes this go away
/gz18.txt
/gz19.txt
[12:15:36][/tmp {jruby-head}]
$ gem fetch jruby-launcher
Downloaded jruby-launcher-1.0.12-java
[12:15:46][/tmp {jruby-head}]
$ lessgem jruby-launcher-1.0.12-java.gem
COPYING
README.txt
Makefile
Rakefile
ng.c
@nicksieger
nicksieger / foreman-specs-jruby.log
Created January 30, 2012 00:51
Foreman specs run with JRuby
$ jruby -v
jruby 1.7.0.dev (ruby-1.9.3-p28) (2012-01-28 efa4931) (Java HotSpot(TM) Client VM 1.6.0_29) [darwin-i386-java]
$ JRUBY_OPTS="--debug -X+O" rake
/Users/nicksieger/Projects/ruby/jruby/bin/jruby -S rspec spec/foreman_spec.rb spec/helper_spec.rb spec/foreman/cli_spec.rb spec/foreman/engine_spec.rb spec/foreman/export_spec.rb spec/foreman/helpers_spec.rb spec/foreman/process_spec.rb spec/foreman/export/base_spec.rb spec/foreman/export/bluepill_spec.rb spec/foreman/export/inittab_spec.rb spec/foreman/export/runit_spec.rb spec/foreman/export/upstart_spec.rb
..........F..................F...................................
Failures:
1) Foreman::CLI run with a valid Procfile and a non-executable command should print an error
Failure/Error: mock_error(subject, "not executable: #{command}") do
require 'enumerator'
class FibonacciSeq
include Enumerable
def initialize
@prev = 0
@curr = 1
end
def each(&block)
if block_given?
@nicksieger
nicksieger / Send to Evernote.scpt
Created January 1, 2012 23:48 — forked from turadg/Send Chrome to OmniFocus.scpt
OmniFocus integrations
-- from http://veritrope.com/code/copy-omnifocus-item-uri-to-evernote/
tell front window of application "OmniFocus"
try
set theTrees to selected trees of content
if (count of theTrees) < 1 then
set theTrees to selected trees of sidebar
end if
if (count of theTrees) < 1 then
mysql> select * from db where host = '%';
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv | Event_priv | Trigger_priv |
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------
module Travis
module Notifications
class Pusher
class Payload
def to_hash
render(:hash)
end
def render(*args)
puts "Pusher::Payload#render"