Skip to content

Instantly share code, notes, and snippets.

@rubiii
rubiii / latest.rb
Created April 10, 2011 12:37
find and copy the latest version of a gem
$ latest haml
Request: http://rubygems.org/api/v1/gems/haml.json
Version: 3.0.25
# cmd+v
$ 3.0.25
$ latest doesnotexist
Request: http://rubygems.org/api/v1/gems/doesnotexist.json
It will be mine. Oh yes. It will be mine.
@rubiii
rubiii / bouncy-castle-java.rb
Created April 29, 2011 09:34
jruby/bundler conflict
# install the latest version of bouncy-castle
$ gem install bouncy-castle-java -v=1.5.0146.1
# create a Gemfile depending on the previous version
source :rubygems
gem "bouncy-castle-java", "1.5.0145.2"
# install the dependencies
@rubiii
rubiii / gist:1023033
Created June 13, 2011 15:50
biersounterwegs config
results_per_page: 100
result_type: recent
search_term: 'biersounterwegs+isitbeeroclock' #find tweets containing any of these terms
twitter_timestamp: 61847783463854082 # the timestamp you want to start searching at
api_endpoint_twitter: 'http://search.twitter.com/search.json'
api_endpoint_tumblr: 'http://www.tumblr.com'
tumblr_username: '[email protected]'
tumblr_password: 'bier?'
update_period: 3 #check for updates every 300 secs = 5 minutes
shouts: 'says' # will be concatenated after the username, before the message: @mr_x says: awesome things on a photo!
@rubiii
rubiii / FortuneFormatter.rb
Created June 20, 2011 20:40 — forked from thilko/FortuneFormatter.rb
A fortune rspec formatter. Make all your specs pass to get a new fortune!
require 'rspec/core/formatters/progress_formatter'
require "net/http"
class FortuneFormatter < RSpec::Core::Formatters::ProgressFormatter
def stop
super
print_fortune if all_passed?
end
def all_passed?
java.lang.NoClassDefFoundError: Could not initialize class com.kenai.jaffl.struct.Struct$Constants
com.kenai.jaffl.struct.Struct$Signed64.<init>(Struct.java:1074)
org.jruby.ext.posix.HeapStruct$Int64.<init>(HeapStruct.java:41)
org.jruby.ext.posix.LinuxHeapFileStat.<init>(LinuxHeapFileStat.java:35)
org.jruby.ext.posix.LinuxPOSIX.allocateStat(LinuxPOSIX.java:26)
org.jruby.ext.posix.LinuxPOSIX.stat(LinuxPOSIX.java:107)
org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:226)
org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
org.jruby.RubyFileTest.directory_p(RubyFileTest.java:87)
org.jruby.RubyFileTest$FileTestFileMethods.directory_p(RubyFileTest.java:428)
@rubiii
rubiii / jruby 1.6.2
Created June 23, 2011 18:28
java.lang.UnsatisfiedLinkError
Java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Datei oder Verzeichnis nicht gefunden
at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:90)
at com.kenai.jffi.Foreign.getInstance(Foreign.java:95)
at com.kenai.jffi.Library.openLibrary(Library.java:151)
at com.kenai.jffi.Library.getCachedInstance(Library.java:125)
at com.kenai.jaffl.provider.jffi.Library.loadNativeLibraries(Library.java:66)
at com.kenai.jaffl.provider.jffi.Library.getNativeLibraries(Library.java:56)
at com.kenai.jaffl.provider.jffi.Library.getSymbolAddress(Library.java:35)
at com.kenai.jaffl.provider.jffi.Library.findSymbolAddress(Library.java:45)
at com.kenai.jaffl.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:188)
@rubiii
rubiii / gist:1043379
Created June 23, 2011 19:17
running env
frontend@hindenburg:~$ env
rvm_gemsets_path=/usr/local/rvm/gemsets
rvm_scripts_path=/usr/local/rvm/scripts
rvm_bin_path=/usr/local/bin
GEM_HOME=/usr/local/rvm/gems/jruby-1.5.3@testserver
rvm_man_path=/usr/local/share/man
TERM=xterm
SHELL=/bin/bash
IRBRC=/usr/local/rvm/rubies/jruby-1.5.3/.irbrc
SSH_CLIENT=172.20.0.2 55832 22
@rubiii
rubiii / gist:1043539
Created June 23, 2011 20:23
running env on 1.6
jrubytest@hindenburg:~/tomcat/logs$ env
rvm_gemsets_path=/usr/local/rvm/gemsets
rvm_scripts_path=/usr/local/rvm/scripts
rvm_bin_path=/usr/local/rvm/bin
GEM_HOME=/usr/local/rvm/gems/jruby-1.6.2
rvm_man_path=/usr/local/rvm/man
TERM=xterm
SHELL=/bin/bash
IRBRC=/usr/local/rvm/rubies/jruby-1.6.2/.irbrc
SSH_CLIENT=172.20.0.2 56734 22
ruby-1.9.2-p180@buildertest ~/Desktop $ gemi savon
Fetching: builder-3.0.0.gem (100%)
Fetching: nori-1.0.2.gem (100%)
Fetching: rack-1.3.2.gem (100%)
Fetching: httpi-0.9.5.gem (100%)
Fetching: nokogiri-1.5.0.gem (100%)
Building native extensions. This could take a while...
Fetching: wasabi-2.0.0.gem (100%)
Fetching: gyoku-0.4.4.gem (100%)
Fetching: akami-1.0.0.gem (100%)
@rubiii
rubiii / gist:1232134
Created September 21, 2011 14:14
namespace identifiers
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/" xmlns:ins0="http://www.avectra.com/2005/">
<soapenv:Header/>
<soapenv:Body>
<ns:Authenticate>
<ins0:userName>test</ins0:userName>
<ins0:password>test</ins0:password>
</ns:Authenticate>
</soapenv:Body>
</soapenv:Envelope>