Skip to content

Instantly share code, notes, and snippets.

View thedeeno's full-sized avatar

Dane O'Connor thedeeno

View GitHub Profile
@thedeeno
thedeeno / LTMangler.js
Created March 25, 2010 22:46
Rough draft of layout trigger functionality
// Mangler that shows how to leverage LayoutTriggers.
// - The default layout is dvorak.
// - While LEFTCTRL is pressed the keyboard is in qwerty modethe layout back to qwerty,
// facilitating the use of standard hotkeys.
// - CAPSLOCK toggles a special 'navigation' auxiliary layout
include('keysyms.js');
include('keynames.js');
include('LayoutTriggers.js');
# encoding: utf-8
source :gemcutter
source 'http://gems.github.com'
# Rails 2.x style.
group :rails do
gem 'rails', '~> 2.3.5', :require => nil
gem 'builder', '~> 2.1.2'
gem 'memcache-client', '>= 1.7.4', :require => nil
gem 'tzinfo', '~> 0.3.12'
#excerpt
...
group :test do
gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git"
gem "rspec", :git => "git://github.com/rspec/rspec.git"
gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git"
var today_date:Date = new Date();
//
var date_Day:Number = (today_date.getDate());
var date_Month:Number = (today_date.getMonth()+1);
var date_Year:Number = (today_date.getYear());
//
//
// ( 8/21 - 10/31 ) …this fall
if ((date_Month>=8) and (date_Month<=9)) {
if ((date_Day>=21) and (date_Day<=31)){
if (todayIsInRange('1/1', '3/20')){
gotoAndStop("winter");
}
else if (todayIsInRange('3/21', '5/17')){
gotoAndStop("spring");
}
else if (todayIsInRange('5/18', '5/31')){
gotoAndStop("memorial");
}
else if (todayIsInRange('6/1', '7/4')){
@thedeeno
thedeeno / test.coffee
Created November 15, 2011 21:29
Event doubling problem
# Models, Foo listens to Bar's 'create' event
class Bar extends Spine.Model
@configure "Bar"
class Foo extends Spine.Model
@configure "Foo"
constructor: ->
super
Bar.bind("create", @barCreated)
@thedeeno
thedeeno / working.coffee
Created November 15, 2011 22:33
Spine: made to work by using a controller instead of model
class Bar extends Spine.Model
@configure "Bar"
class Foo extends Spine.Controller
constructor: ->
super
Bar.bind("create", @barCreated)
barCreated: (foo) =>
@thedeeno
thedeeno / model.js
Created November 18, 2011 02:31
Actual failing spec for duping
// spec/model.js
it("can be duplicated", function(){
var a = new Asset({name: "foo"});
a.save();
a.name = "bar";
b = Asset.find(a.id);
expect(a.name).toEqual("bar");
expect(b.name).toEqual("foo");
Dim bocElements as Collection
Dim bocRange As Range
Set bocElements = New Collection
Set bocRange = Range("B4:B756")
For Each cell In bocRange
bocElements.add cell.Value
Next
@thedeeno
thedeeno / sunspot.rb
Created March 15, 2012 04:43 — forked from thhermansen/sunspot.rb
Sunspot rspec helper file
#
# Put this in spec/support/
# Will use a sunspot stub session as default in all tests.
#
# To actually test the search you'll need something like:
# describe "something", sunspot: true do
# ...some tests...
# end
#
# If you do this in your spec helper: