Skip to content

Instantly share code, notes, and snippets.

View audionerd's full-sized avatar

Eric Skogen audionerd

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@mattmccray
mattmccray / backbone_helper.coffee
Created October 14, 2010 08:44
Use Backbone.js classes as native CoffeeScript classes
# Backbone CoffeeScript Helpers by M@ McCray.
# Source: http://gist.github.com/625893
#
# Use Backbone classes as native CoffeeScript classes:
#
# class TaskController extends Events
#
# class TaskView extends View
# tagName: 'li'
# @SRC: '<div class="icon">!</div><div class="name"><%= name %></div>'
@ismasan
ismasan / async_require.js
Created October 25, 2010 15:59
Dynamically require scripts in the browser, with async callback for when all dependencies are loaded
/* Dynamically require scripts in the browser, with async callback for when all dependencies are loaded
Example:
function pageReady() {
// Init your code here
alert('All dependencies loaded!');
}
_require(['/json2.js', 'http://server.com/foo.js'], pageReady);
@netzpirat
netzpirat / 0_README.md
Created November 12, 2010 10:42
Continuous CoffeeScript testing with Guard and Jasmine

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard
@geemus
geemus / Gemfile
Created November 22, 2010 22:45
fog - resume uploading example
source "http://rubygems.org"
gem 'fog'
@Nutrox
Nutrox / gist:778619
Created January 13, 2011 21:14
AS3 - Isometric matrix transformation.
const DEGRAD:Number = Math.PI / 180;
var iso:Matrix = new Matrix();
iso.rotate( -45 * DEGRAD ); // rotate anti-clockwise by 45 degrees
iso.scale( 1.0, 0.5 ); // scale vertically by 50%
iso.translate( 100, 100 ); // set position if needed
displayObject.transform.matrix = iso;
@aurelian
aurelian / controller.rb
Created January 20, 2011 16:03
dumps sass variables
# ref: http://bit.ly/fN2ep8
# http://twitpic.com/3rr8dk
def sass_colors
engine= Sass::Engine.new(File.read("app/stylesheets/_colors.scss"), :syntax => :scss, :load_paths => ["app/stylesheets"])
environment= Sass::Environment.new
engine.to_tree.children.each do | node |
next unless node.kind_of? Sass::Tree::VariableNode
node.perform environment
end
@treyhunner
treyhunner / screenshot.sh
Created March 29, 2011 14:59
Grab a screenshot, give it a public dropbox URL, shorten the URL, and copy it to the clipboard
#!/bin/sh
# Ubuntu-specific modification of http://wiki.dropbox.com/TipsAndTricks/ShareScreenshots
# Change these
DB_USER_ID=YOURDBUSERID
BITLY_USERNAME=YOURBITLYUSERNAME
BITLY_API_KEY=YOURBITLYKEYHERE
DROPBOX_PUBLIC_DIR=~/Dropbox/Public
SCREENSHOT_DIR=screenshots
@jeremy
jeremy / schema.xml
Created April 2, 2011 00:53
Basecamp Solr schema
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="basecamp" version="1.3">
<types>
<!-- indexed/stored verbatim -->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- "true" or "false" -->
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- binary data, base64 -->
@seven1m
seven1m / sass_with_jammit.rb
Created April 13, 2011 20:59
SASS with Jammit
# hack to auto compile sass when Jammit runs in Dev/Test mode
require 'haml/util'
require 'sass/engine'
module Jammit
module Helper
SASS_TIMESTAMPS = {}
def include_stylesheets_with_sass(*packages)