Skip to content

Instantly share code, notes, and snippets.

View kreas's full-sized avatar
:shipit:
Heathen

Tim Warren kreas

:shipit:
Heathen
View GitHub Profile
# Default set of awesome for my rails projects.
gem 'RedCloth', :lib => 'redcloth'
gem 'haml'
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
plugin 'ssl_requirement', :git => 'git://github.com/rails/ssl_requirement.git'
plugin 'hoptoad_notifier', :git => "git://github.com/thoughtbot/hoptoad_notifier.git"
initializer 'hoptoad.rb', <<-FILE
HoptoadNotifier.configure do |config|
<script src="https://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
@kreas
kreas / Minitest rake task
Created April 6, 2012 15:45
Minitest rake task
require "rake/testtask"
Rake::TestTask.new(:test => "db:test:prepare") do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
end
task :default => :test
gem "rspec-rails", :group => [:test, :development]
group :test do
gem "factory_girl_rails"
gem 'capybara'
gem "guard-rspec"
end
@kreas
kreas / ^_^.css
Created April 17, 2012 14:18
^_^
div.spawn{
background :yellow;
color: #000;
border: 1px solid #000;
width: 25px;
height: 25px;
text-align: center;
padding: 2px 0;
position: absolute;
}
@kreas
kreas / capybara cheat sheet
Created August 14, 2012 14:27 — forked from zhengjia/capybara cheat sheet
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')
@kreas
kreas / gist:3558224
Created August 31, 2012 20:04
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@kreas
kreas / gist:3625443
Last active October 10, 2015 03:27
Starter Gemfile - Mongoid
source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem 'sass-rails-bootstrap'
gem 'haml-rails'
gem 'jquery-rails'
gem 'RedCloth'
gem 'kaminari'
gem 'devise'
gem 'resque'
@kreas
kreas / gist:3719847
Created September 14, 2012 04:45
Set the default date format in Rails 3
#environment.rb
Date::DATE_FORMATS.merge!(:default => "%m/%d/%Y")
@kreas
kreas / etc_init.d_unicorn_example.co.uk
Created December 5, 2012 16:48 — forked from rubysolo/etc_init.d_unicorn_example.co.uk
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
#! /bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn