This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder