Skip to content

Instantly share code, notes, and snippets.

View cbrumelle's full-sized avatar

Colin Brumelle cbrumelle

View GitHub Profile
<div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}>
{purchaseComplete ? (
<div className="purchase-complete">
<h2>Thanks!</h2>
<p>
Thank you for your purchase of {formatPrice(this.state.total)}.
We’ll send you a receipt shortly.
</p>
<p>
<button
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@cbrumelle
cbrumelle / sequel_to_json.rb
Created July 13, 2010 01:00
Add 'to_json' method to Sequel datasets
# Monkey patch/hack for adding in a to_json for Sequel datasets
# See http://sequel.rubyforge.org
class Sequel::Dataset
def to_json
naked.all.to_json #Note: 'naked' converts dataset to plain hash...
end
end
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby