Skip to content

Instantly share code, notes, and snippets.

$gist-background-color: #323C45
$gist-border-color: darken($gist-background-color,2%)
#primary .gist
width: 500px
.gist-file
+border-radius(4px)
border-color: $gist-border-color
overflow: hidden
.gist-syntax
@karlbright
karlbright / elementtest.html
Created March 25, 2011 06:12
Element Test
<h1>Heading 1</h1><p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h2>Heading 2</h2><p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h3>Heading 3</h3><p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h4>Heading 4</h4><p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h5>Heading 5</h5><p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h6>Heading 6</h6><p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<blockquote><p>Paragraph inside Blockquote: Nam libero leo, elementum in, dapibus a, suscipit vitae, purus. Duis arcu. Integer dignissim fermentum enim. Morbi convall
BAILIFF; Circuit court, Department 6-B is now in session, the Honourable Benjamin Kinberg presiding. Thursday, the seventh day of December.
MARTIN WELLS: Thursday? It's not Thursday.
JANET WILSON: Shh!
MARTIN WELLS: (insistent) It's Saturday. Yesterday was Friday and...
JANET WILSON: Today is Thursday. There's no court on Saturday. You know that. (concerned) Martin, do you feel all right?
@karlbright
karlbright / best_model.rb
Created April 27, 2011 00:22 — forked from ltw/best_model.rb
Order of a standard Model
class Model < ParentModel
include Foo::Bar
extend Bar::Baz
acts_as_authentic
dsl_specific_flags
module InternalModule
...
end
var request = require('request'), jsdom = require('jsdom'), sys = require('sys');
var client = require("ranger").createClient("thefrontiergroup1","5945b6836f9a47654a522d70af824498e348ff9c");
client.room(396980,function(room) {
room.listen(function(message) {
// start drbl
if(message.type == "TextMessage" && message.body.match(/drbl.in\//)) {
sys.puts("[event] Got drbl.in link, processing now...");
var url = 'http://' + message.body.match(/drbl.in\/.{4}/)[0];
jsdom.env(url, ['http://code.jquery.com/jquery-1.5.min.js'], function(errors,window) {
def connection(options={})
@connection ||= RestClient::Resource.new(\
"#{protocol}://www.pivotaltracker.com/services/v3", \
:headers => {'X-TrackerToken' => @token, 'Content-Type' => 'application/xml'})
end
def connection(options={})
raise NoToken unless @token.present?
@connections ||= {}
@connections[@token] ||= RestClient::Resource.new(\
"#{protocol}://www.pivotaltracker.com/services/v3", \
:headers => {'X-TrackerToken' => @token, 'Content-Type' => 'application/xml'})
end
Loading development environment (Rails 3.0.7)
>> "faxes".singularize
=> "fax"
>> "fax".pluralize
=> "faxes"
>> [1, 2, 3].each {|i| p helper.pluralize i, "fax" }
"1 fax"
"2 faxes"
"3 faxes"
=> [1, 2, 3]
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'net/http'
def OpenURI.redirectable?(uri1, uri2)
uri1.scheme.downcase == uri2.scheme.downcase || (/\A(?:http|ftp|https)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
end
module Daytrotter
@karlbright
karlbright / rspec-syntax-cheat-sheet.rb
Created August 19, 2011 02:23 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")