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
@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:
@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

=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 / 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 / ckeditor_force_paste_plain_text.js
Created May 9, 2012 01:45
CKeditor Force Paste as Plain Text
Add the following code snippet to the config.js file to force all pasted text into the editor window as plain text.
config.forcePasteAsPlainText = true;
@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
@jaymiejones86
jaymiejones86 / jquery_pdf_new_window.js
Created May 28, 2012 22:08
Open any anchor which has a file extension of PDF in a new window with jQuery.
$('a[href$=".pdf"]').click(function(e) {
e.preventDefault();
window.open(this.href);
});
@jaymiejones86
jaymiejones86 / osx_lion_rail_setup.md
Created July 1, 2012 23:18 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@jaymiejones86
jaymiejones86 / gist:3745981
Created September 18, 2012 21:20
Running Pow And MAMP Pro Together

Uninstall Pow if installed already

curl get.pow.cx/uninstall.sh | sh

Change pow's firewall to redirect all traffic from port 88 instead of port 80 (standard port)

echo 'export POW_DST_PORT=88' >> ~/.powconfig
@jaymiejones86
jaymiejones86 / gist:3868169
Created October 10, 2012 20:21
Fix Drush PDO issue on Mac OSX
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock