Skip to content

Instantly share code, notes, and snippets.

--edit the list to include any apps that distract you from doing stuff
--then complile it with osacompile or AppleScript Editor and add as a
--hotkey in Quicksilver
set distractingApps to {"Adium", "Mail", "Nambu", "NetNewsWire", "Thunderbird", "Vienna"}
repeat with distraction in distractingApps
tell application distraction
quit
end tell
*.o
*.so
*.bundle
Makefile
#!/usr/bin/env ruby
require 'pp'
require 'inline'
class Scan
def initialize(seq)
@seq = seq
end
<project default="query-to-property">
<path id="hsql" >
<pathelement location="lib/hsqldb-2.2.6.jar" />
</path>
<property name="db-driver" value="org.hsqldb.jdbc.JDBCDriver" />
<property name="db-url" value="jdbc:hsqldb:mem:mydb" />
<target name="fetch-hsqldb">
/*
N.B. this program doesn't include any error checking. In particular you'll have
to do all the rb_protect stuff
*/
#include <stdio.h>
#include "ruby.h"
struct Address {
char * town;
if (RTEST(rf_call(path,is_file,Qnil))) {
body = rf_call(path, id_read_file,Qnil);
/* I don't wanna deal with non-strings :D. */
/* this check means we don't need to use StringValue */
if (TYPE(body) != T_STRING) {
return -ENOENT;
}
/* We have the body, now save it the entire contents to our
#include "ruby.h"
struct Address {
char * town;
};
static VALUE address_alloc(VALUE klass) {
struct Address* address = malloc(sizeof(struct Address));
VALUE obj = Data_Wrap_Struct(klass, 0, free, address);
@mattwildig
mattwildig / gist:2598534
Created May 4, 2012 23:54
gem contents sass
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/CONTRIBUTING
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/MIT-LICENSE
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/README.md
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/REVISION
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/Rakefile
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/VERSION
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/VERSION_NAME
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/bin/sass
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/bin/sass-convert
/Users/matt/.rvm/gems/ruby-1.9.3-p194/gems/sass-3.1.16/bin/scss
@mattwildig
mattwildig / gist:2921460
Created June 13, 2012 02:31
Two test runs?
$ rake test
/Users/matt/.rvm/rubies/ruby-1.8.7-p358/bin/ruby -I"lib:lib:test" -I"/Users/matt/.rvm/gems/ruby-1.8.7-p358/gems/rake-0.9.2.2/lib" "/Users/matt/.rvm/gems/ruby-1.8.7-p358/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/engine_test.rb" "test/filters_test.rb" "test/haml-spec/ruby_haml_test.rb" "test/helper_test.rb" "test/template_test.rb" "test/util_test.rb"
Run options: --seed 21449
# Running tests:
......................................................................................................................................................................................................................................................................................................................................................................
Finished tests in 0.879086s, 407.2412 tests/s, 1887.1874 assertions/s.
@mattwildig
mattwildig / m_app.rb
Created July 17, 2012 00:05
Using Rack::Builder without eval-ing block in another context.
require 'rack'
require 'forwardable'
class MyApp
extend Forwardable
def_delegators :@builder, :use, :map, :run, :call
def initialize
@builder = Rack::Builder.new