Skip to content

Instantly share code, notes, and snippets.

@qmx
qmx / Gemfile
Created June 10, 2011 03:25 — forked from napcs/Gemfile
warbler + sinatra problem
source :rubygems
gem 'sinatra', '1.2.3'
gem 'tilt', "1.3"
gem 'rack', "1.2.2"
gem 'sinatra-respond_to', '0.7.0'
@qmx
qmx / gist:1407191
Created November 29, 2011 23:43 — forked from anonymous/gist:1406238
yammer moving away from scala
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@qmx
qmx / mersenne-twister.js
Created February 4, 2012 03:45 — forked from banksean/mersenne-twister.js
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@qmx
qmx / error
Created February 23, 2012 15:23 — forked from owenthereal/error
error when installing posix-spawn gem with JRuby 1.6.7
Installing posix-spawn (0.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Owen/.rvm/rubies/jruby-1.6.7/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very well.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
creating Makefile
make
cc -I. -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include/ruby -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fPIC -DTARGET_RT_MAC_CFM=0 -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -Wall -arch i386 -c posix-spawn.c
# Option 1 or 2?
# 1
return @app.call(env) if @exclude && @exclude.call(env)
# 2
if @exclude && @exclude.call(env)
return @app.call(env)
end
public class Process extends DynObject {
public Process() {
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
@qmx
qmx / gist:3765407
Created September 22, 2012 07:00 — forked from briandealwis/gist:782862
One-liner to turn jar with Main-Class into executable shell script
# turn a jar with a Main-Class into a stand alone executable
(echo '#!/usr/bin/env java -jar'; cat blahblah.jar) > blah
# turn a jar with a particular main clas into a stand alone executable
(echo '#!/usr/bin/env java -jar package.MainClass'; cat blahblah.jar) > blah
@qmx
qmx / gist:4078919
Created November 15, 2012 14:35 — forked from matzew/gist:4078909
URL rootUrlServerOne = new URL("http://foooo.rhcloud.com/todo-server");
URL rootUrlServerTwo = new URL("http://baaaaarrrr.rhcloud.com/todo-server");
Pipeline pipeline = new Pipeline(rootUrlServerOne);
PipeConfig<Project> config1 = new PipeConfig<Project>(Project.class);
PipeConfig<Task> config2 = new PipeConfig<Task>(rootUrlServerTwo, Task.class);
Pipe<Project> projects = pipeline.pipe(config1);
Pipe<Task> taks = pipeline.pipe(config2);
@qmx
qmx / apt-init.pp
Created December 23, 2012 21:44 — forked from fnando/apt-init.pp
class apt-get::update {
exec { "apt-get update":
command => "apt-get update"
}
}
@qmx
qmx / .gitignore
Created February 16, 2013 03:19 — forked from raggi/.gitignore
specs.4.8
prerelease_specs.4.8
versions.list
names.list
specs
deps
gems