Skip to content

Instantly share code, notes, and snippets.

View britt's full-sized avatar

Britt Crawford britt

View GitHub Profile
#profile
.left.column
#date= print_date
#address= current_user.address
.right.column
#email= current_user.email
#bio= current_user.bio
module DieNode
def roll
rand(sides.to_i) + 1
end
end
module ModifierNode
def to_i
amount.to_i * sign.to_multiplier
end
grammar Dice
rule roll
(rolls:digits? "(" roller:roll ")" modifier:modifier? modifier_roller:modifier_roll? / rolls:digits? roller:die modifier:modifier? modifier_roller:modifier_roll?) <RollNode>
end
rule modifier_roll
space* sign:plus_minus space* amount:roll <ModifierNode>
end
rule modifier
// ==UserScript==
// @name Greasefire
// @namespace jquery
// @description Send fluid notifications when new messages are sent in Campfire chat
// @include *.campfirenow.com
// ==/UserScript==
if(unsafeWindow.jQuery){
$ = unsafeWindow.jQuery;
} else {
javascript:(function(){var%20k="%20-site:experts-exchange.com%20-site:swik.net%20-site:bytes.com";if(document.f){document.f.q.value=document.f.q.value+k;}else{document.gs.q.value=document.gs.q.value+k}})()
ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
require 'spec/autorun'
require 'spec/rails'
Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
config.use_transactional_fixtures = true
class CreateUrls < ActiveRecord::Migration
def self.up
create_table :urls do |t|
t.string :slug
t.text :location
t.timestamps
end
end
def self.down
config.gem "rspec", :version => ">= 1.2.6", :lib => 'spec'
config.gem "rspec-rails", :version => ">= 1.2.6", :lib => 'spec/rails'
// HiveDB uses a partition by key strategy so you must select a relevant
// property of the data to use to split the data set. We call this the
// partitioning key. Ideally, this should be a dimension or relationship
// that you never need to join across since HiveDB does not support joins
// across shards.
//
// Insert the partitioning key in order to allocate it to a shard.
// [In this example we are partitioning silverware by type.]
hive.directory().insertPrimaryIndexKey(spork.getType());
CmdUtils.CreateCommand({
name: "subscribe",
description: "Subscribe to a feed for the current page in Google Reader -- I didn't write this. I found it on the web somewhere (that I've now forgotten) and just pasted it here to test Gists Ubiquity command functionality.",
help: "Subscribe to a feed for the current page in Google Reader (does same thing as their bookmarklet)",
execute: function(tags) {
var document = context.focusedWindow.document;
var b=document.body;
var GR________bookmarklet_domain='http://www.google.com';
if (b&&!document.xmlVersion) {
void(z=document.createElement('script'));