Skip to content

Instantly share code, notes, and snippets.

View jaymiejones86's full-sized avatar
🏠
Working from home

Jaymie Jones jaymiejones86

🏠
Working from home
View GitHub Profile
<?php
$args = array(
'post_type' => 'review',
'post_status' => 'publish',
'posts_per_page' => '-1',
'orderby' => 'ID',
'order' => 'DESC',
);
@jaymiejones86
jaymiejones86 / database_cleaner.rb
Created May 9, 2014 05:21
Database Cleaner Config
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation
DatabaseCleaner.start
end
@jaymiejones86
jaymiejones86 / office_upgrades.md
Last active August 29, 2015 14:06
Office Upgrades
  • Dual Monitor Setup
  • Keyboard
  • Mouse/Trackpad
  • Chair
  • Desk
  • Raided NAS
  • Air con (that works and stops dogs from chewing cables to stuff it)

Web Development Contract for [project title]

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

So in short;

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@jaymiejones86
jaymiejones86 / rails31init.md
Created May 4, 2012 09:31 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@jaymiejones86
jaymiejones86 / gist:2593628
Created May 4, 2012 09:35 — forked from donnoman/gist:1112243
Cucumber Template
# http://rspec.info/
# http://peepcode.com/products/rspec-user-stories
# http://dannorth.net/whats-in-a-story
# http://www.lukeredpath.co.uk/2006/8/29/developing-a-rails-model-using-bdd-and-rspec-part-1
# http://www.benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories/
# http://www.benmabey.com/2008/02/04/rspec-plain-text-stories-webrat-chunky-bacon/
# http://www.chariotsolutions.com/slides/pdfs/ete2008-IntegrationTestingWithRSpec.pdf
# http://www.joesniff.co.uk/ruby/telling-a-good-story-rspec-stories-from-the-trenches.html
# How does using stories help testing?
@jaymiejones86
jaymiejones86 / Capistrano-Deployment-Recipe.rb
Created May 4, 2012 09:29 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
=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')
@jaymiejones86
jaymiejones86 / deploy.rb
Created May 22, 2012 01:02 — forked from D3xx73r/deploy.rb
Capistrano deploy file
require "bundler/capistrano"
# Define your server here
server "<server>", :web, :app, :db, primary: true
# Set application settings
set :application, "<app_name>"
set :user, "<deployment_user>" # As defined on your server
set :deploy_to, "/home/#{user}/apps/#{application}" # Directory in which the deployment will take place
set :deploy_via, :remote_cache