Skip to content

Instantly share code, notes, and snippets.

View wrburgess's full-sized avatar
:shipit:
Shippin'

Randy Burgess wrburgess

:shipit:
Shippin'
View GitHub Profile
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', YOUR_CODE']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
class DatafeedsController < ApplicationController
API_KEY = 'my encrypted key is here'
# Parses Foxycart datafeed v060
# see http://wiki.foxycart.com/docs/datafeed for details
def create
require 'ruby-rc4'
require 'nokogiri'
=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')
@wrburgess
wrburgess / gist:5504600
Created May 2, 2013 19:12 — forked from shripadk/gist:552554
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
Note: I am not using the Heroku Zerigo DNS add-on, instead I have a separate Zerigo account for my DNS needs. I do this because Zerigo offers 30 hosts on free direct accounts, versus only 10 hosts on the free Heroku add-on.
#!/bin/bash
# see http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
# Author: David Underhill (original)
# Author: Mike Slinn (runs from any directory)
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-remove-history path1 path2
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
if Rails.env.development? || Rails.env.test?
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
# include from an initializer
module HstoreAccessor
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def hstore_accessor(hstore_attribute, *keys)
Array(keys).flatten.each do |key|
# Debugging with POW!
#
# Setup POW!'s ~/.powconfig with the following:
# export POW_WORKERS=1
# export POW_TIMEOUT=3600
#
# Run `bundle exec rdebug -c` in the Terminal to start the debugger
if (Rails.env.development? || Rails.env.test?) && !(defined?($rails_rake_task) && $rails_rake_task)
puts "=> Debugger enabled"
language: ruby
rvm:
- 1.9.3
env:
- DB=sqlite
- DB=mysql
- DB=postgresql