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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<array> | |
<dict> | |
<key>AudioList</key> | |
<array> | |
<dict> | |
<key>AudioBitrate</key> | |
<string>160</string> |
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 'state_machine' | |
class LightSwitch | |
attr_accessor :dark_outside | |
alias :dark_outside? :dark_outside | |
state_machine :state, :initial => :_off_ do | |
event :turn_on do | |
transition :_off_ => :_on_, :if => lambda {|ls| ls.dark_outside? } | |
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
source :rubygems | |
gem "jdbc-openedge", "11.1" | |
gem "dm-openedge-adapter", :git => "git://github.com/abevoelker/dm-openedge-adapter.git" | |
gem "data_mapper", "~> 1.2.0" |
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 'sinatra' | |
require './models' | |
get '/customers' do | |
Customer.all.to_json | |
end | |
get '/customer/:cust_num' do |cust_num| | |
@customer = Customer.get(cust_num) | |
if @customer |
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
class Hash | |
def hflatten(path=[]) | |
self.inject({}) do |a,(k,v)| | |
if v.is_a? Hash | |
# Recurse | |
a.merge(v.hflatten(path.dup << k)) | |
else | |
# Base case | |
a[(path.dup << k).join('.')] = v; a | |
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
data = {:name => 'Bob', :gender => 'm', :relation => 'Uncle' } | |
pdfs = capture_pdfs do | |
pdf :basic_info do | |
text 'name', data[:name] | |
radio_group 'sex' do | |
fill 'male', :when => data[:gender] == 'm' | |
fill 'female', :when => data[:gender] == 'f' | |
end | |
checkbox_group 'relation' do |
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
;(function() { | |
var Form = Backbone.Form, | |
editors = Form.editors; | |
// we don't want our nested form to have a (nested) <form> tag | |
// (currently bbf includes form tags: https://github.com/powmedia/backbone-forms/issues/8) | |
// aside from being strange html to have nested form tags, it causes submission-upon-enter | |
Form.setTemplates({ | |
nestedForm: '<div class="bbf-nested-form">{{fieldsets}}</div>' |
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
$ rvm info | |
jruby-1.6.7.2@temp: | |
system: | |
uname: "Linux STAGING1 2.6.32-25-server #45-Ubuntu SMP Sat Oct 16 20:06:58 UTC 2010 x86_64 GNU/Linux" | |
system: "ubuntu/10.04/x86_64" | |
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)" | |
zsh: "/usr/bin/zsh => zsh 4.3.10 (x86_64-unknown-linux-gnu)" |
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
class RateLimiter | |
include Celluloid | |
def initialize(actions_per, seconds) | |
@bucket, @nice = actions_per, seconds | |
end | |
def request | |
wait :bucket_increment unless @bucket > 0 | |
@bucket -= 1 |
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
diff --git a/Gemfile.lock b/Gemfile.lock | |
index 267c383..6b33c37 100644 | |
--- a/Gemfile.lock | |
+++ b/Gemfile.lock | |
@@ -119,16 +119,16 @@ GEM | |
remote: http://rubygems.org/ | |
specs: | |
- actionmailer (3.2.13) | |
- actionpack (= 3.2.13) | |
- mail (~> 2.5.3) |