Skip to content

Instantly share code, notes, and snippets.

// shortcut.m
//
// compile:
// gcc shortcut.m -o shortcut.bundle -g -framework Foundation -framework Carbon -dynamiclib -fobjc-gc -arch i386 -arch x86_64
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
@interface Shortcut : NSObject
@chapados
chapados / quiz.rb
Created May 15, 2009 20:23 — forked from ryanb/quiz.rb
# COMMUNITY CHALLENGE
#
# How would you test this Quiz#problem method? Only two rules:
#
# 1. The tests should fail if any part of the application breaks.
# For example: If "gets" is moved before "puts" then the tests should
# fail since that breaks the application.
#
# 2. You cannot change the Quiz class. But you can use whatever framework
# and tools you want for the tests. (RSpec, Cucumber, etc.)
#!/usr/bin/env ruby
results = ARGV.shift # input file from cli
measures_full = {'PROP 1A'=>'Safe, Reliable High-Speed Train Bond Act',
'PROP 2' =>'Standards for Confining Farm Animals',
'PROP 3' =>"Children's Hospital Bond Act. Grant Program.",
'PROP 4' =>"Parent Notif. Before Terminating Minor's Pregnancy",
'PROP 5' =>'Nonviolent Drug Offense. Sentencing, Parole, Rehab',
'PROP 6' =>'Police, Law Enforcement Funding. Criminal Laws.',
require 'java'
require 'iText-2.1.3.jar'
module Java
import 'java.io.FileOutputStream'
import 'com.lowagie.text.pdf.PdfReader'
import 'com.lowagie.text.pdf.PdfStamper'
import 'com.lowagie.text.pdf.PdfWriter'
import 'com.lowagie.text.pdf.BaseFont'
end
require 'date'
requrie 'yaml'
class DateTime
yaml_as "tag:ruby.yaml.org,2002:datetime"
def DateTime.yaml_new(klass, tag, val)
if String === val
self.parse(val)
else