Skip to content

Instantly share code, notes, and snippets.

#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);
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
/*
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;
<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">
#!/usr/bin/env ruby
require 'pp'
require 'inline'
class Scan
def initialize(seq)
@seq = seq
end
*.o
*.so
*.bundle
Makefile
--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