Skip to content

Instantly share code, notes, and snippets.

View RobinDaugherty's full-sized avatar

Robin Daugherty RobinDaugherty

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')
@henare
henare / mw-to-gollum.rb
Created March 10, 2011 02:41
Imports a MediaWiki XML export into a Gollum wiki
#!/usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'gollum'
wiki = Gollum::Wiki.new('openaustralia.wiki')
file = File.open("OpenAustralia-20110309232515.xml", "r")
doc = Hpricot(file)
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline
@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created March 22, 2012 12:50
Script to install cURL CA certificates on OS X without macports
#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
else
@andrewrocco
andrewrocco / ga-ratio.js
Created July 17, 2012 15:48
Pixel Aspect Ratio Google Analytics Custom Variable
// Create the test
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal";
..
// Pass it along through GA
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
// --- IMPORTANT LINE!
// params: event method, custom variable slot, variable name, variable value, scope level
@tcmacdonald
tcmacdonald / front_matter.rb
Created October 30, 2012 14:54
Pulling front matter from Rails views template.
require 'active_support/concern'
module FrontMatter
extend ActiveSupport::Concern
included do
helper_method :front_matter
end
def front_matter
@soderlind
soderlind / config.ru
Created December 4, 2012 20:54 — forked from paulcook/config.ru
config.ru for Pow + Wordpress - based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/. Added rewrite rule for WordPress Multi Site. More at http://soderlind.no/archives/2012/12/02/wordpress-and-pow/
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/
# added hackery to work around wordpress issues - Patrick Anderson (patrick@trinity-ai.com)
# added rubygems, replaced script_path with script from path_parts, added to_return to fix return error - Paul Cook
# clearly this could be cleaner, but it does work
# added rewrite rule for WordPress Multi Site - Per Soderlind (see also http://soderlind.no/archives/2012/12/02/wordpress-and-pow/)
require 'rubygems'
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
@ivanvanderbyl
ivanvanderbyl / account_routes.js
Last active January 31, 2016 17:55
Using Ember initializers and injections to setup the `currentUser` within your app.
App.AccountEditRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('content', this.get('currentUser'));
}
});
@ayamomiji
ayamomiji / gist:4736614
Last active November 10, 2017 11:16
turbolinks + angularjs
bootstrapAngular = ->
$('[ng-app]').each ->
module = $(this).attr('ng-app')
angular.bootstrap(this, [module])
$(document).on('page:load', bootstrapAngular)