Skip to content

Instantly share code, notes, and snippets.

View twmills's full-sized avatar

Theo Mills twmills

View GitHub Profile
#----------------------------------------------------------------------------
# Git Setup
#----------------------------------------------------------------------------
append_file '.gitignore', %{
/.bundle
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
#----------------------------------------------------------------------------
# Capistrano
#----------------------------------------------------------------------------
capify!
file 'Capfile', <<-FILE
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
FILE
!!! 5
%html{:lang => 'en', :class => 'no-js'}
%head
%meta{ :charset => 'utf-8' }
/[if IE]
%meta{ "http-equiv" => 'X-UA-Compatible', :content => 'IE=edge,chrome=1' }
%title Theo W. Mills
%meta{ :name => 'description', :content => '' }
%meta{ :name => 'author', :content => '' }
%meta{ :name => 'viewport', :content => 'width=device-width; initial-scale=1.0; maximum-scale=1.0;' }
gem "will_paginate", "~> 3.0.pre2"
!!! 5
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}/
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
%title
@twmills
twmills / pre-commit
Created February 23, 2011 03:04
git pre-commit example
#!/bin/bash
source ".rvmrc"
ruby .git/hooks/run_tests.rb
run_tests.rb
-----------
puts "Running tests..."
`bundle exec rspec spec/* > /dev/null 2>&1 && cucumber -r features > /dev/null 2>&1`
if $? != 0
=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')
CREATE USER 'export'@'localhost' IDENTIFIED BY 'xxx';
GRANT ALL PRIVILEGES
ON dbname.*
TO 'export'@'localhost'
WITH GRANT OPTION;
@twmills
twmills / new_gist_file.sh
Created December 20, 2013 14:55
Empty rvm
rvm gemset empty
@twmills
twmills / create_order.sh
Last active January 3, 2016 12:29
ShippingEasy Example API Call (subject to change)
curl -XPOST https://app.shippingeasy.com/api/orders?api_key=fc2d75c0212154d4ff394bfdc436b45a&api_timestamp=1390314539&api_signature=662f775289a34b3852fa28230f396ae73433c793c86b120be6bf7252816d83a1 -d '{
"order" : {
"order_identifier":"ABC-1004",
"ordered_at":"2014-01-16 14:37:56 -0600",
"order_status":"awaiting_shipment",
"subtotal_including_tax":10.0,
"total_including_tax":10.0,
"total_excluding_tax":10.0,
"discount_amount":0,
"shipping_cost_including_tax":1.5,