Skip to content

Instantly share code, notes, and snippets.

requestData = "STS\r".dataUsingEncoding(NSUTF8StringEncoding)
request = ORSSerialRequest.requestWithDataToSend(requestData, userInfo: nil, timeoutInterval: 3.0, responseEvaluator: lambda {|inputData|
puts "HERE"
return true
})
@serial.sendRequest(request)
requestData = NSString.alloc.initWithData("STS\r", encoding:NSUTF8StringEncoding)
sample_request = ORSSerialRequest.requestWithDataToSend(requestData, userInfo: '', timeoutInterval: 3.0, responseEvaluator:-> inputData { return true })
@serial.sendData(sample_request)
class ORSSerialPortDelegate
class << self
def didReceiveData(serialPort)
puts "HERE"
end
def serialPortWasOpened
puts "OPENED"
end
@zenom
zenom / 0-readme.md
Created November 29, 2012 20:17
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@zenom
zenom / gist:3921189
Created October 19, 2012 22:58 — forked from olistik/gist:2627011
Ubuntu 12.10 setup (rbenv/rvm, janus, postgres)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git
  • Copy/paste from the command line:
sudo apt-get install xclip
jar tf smuggler-0.0.2-standalone.jar | more master * ] 6:07 PM
META-INF/MANIFEST.MF
META-INF/maven/smuggler/smuggler/pom.xml
META-INF/maven/smuggler/smuggler/pom.properties
smuggler/core$_main.class
smuggler/core$fill_handbag.class
smuggler/core$generate_shipment.class
smuggler/core$get_random_number.class
smuggler/core$loading__4410__auto__.class
smuggler/core$parse_int.class
Status = Backbone.Model.extend({
initialize: function() {
this.id = this.attributes._id;
}
});
StatusCollection = Backbone.Collection.extend({
model: Status,
url: '/social/twitter/status',
it 'send message should trigger tinder' do
connection = mock('Tinder::Campfire')
room = mock('Tinder::Room')
Tinder::Campfire.stub!(:new).and_return(connection)
connection.stub_chain(:find_room_by_name).and_return(room)
room.stub!(:speak)
room.should_receive(:leave)
@build.build_completed!
end
@zenom
zenom / model.rb
Created December 5, 2010 03:50
campfire test
require 'spec_helper'
describe Notifier::Campfire do
it { should have_field(:ssl).of_type(Boolean) }
before(:each) do
@build = Fabricate(:build, :state => :building)
end
Failures:
1) Notifier::Campfire should send a failed message
Failure/Error: @build.build_failed!
undefined method `find_room_by_name' for nil:NilClass
# ./app/models/notifier/campfire.rb:27:in `send_message'
# ./app/models/notifier/campfire.rb:13:in `send_failed'
# ./app/models/build.rb:64:in `failed_build'
# ./spec/models/notifier/campfire_spec.rb:12