Skip to content

Instantly share code, notes, and snippets.

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
# README
# pass in this file when creating a rails project
#
# for example:
# rails _3.2.14_ new awesome_app -T -d postgresql -m ~/.kickhash_template.rb
remove_file "README.rdoc"
create_file "README.md", "TODO"
gem_group :development, :test do
@ml242
ml242 / gist:7987912
Last active December 31, 2015 12:39
Setting up some Cucumber tests
$ rails _3.2.14_ new cuke -T -d postgresql
// no tests -T
Gemfile
group :test do
gem 'cucumber-rails', require: false
gem 'rspec-rails'
gem 'guard-cucumber'
gem 'database-cleaner'
gem 'guard-rspec'
@ml242
ml242 / rails_setup.rb
Last active December 30, 2015 01:29 — forked from phlco/rails_setup.rb
# README
# pass in this file when creating a rails project
#
# for example:
# rails _3.2.14_ new awesome_app -d postgresql -m ~/rails_setup.rb
remove_file "README.rdoc"
create_file "README.md", "TODO"
gem_group :development, :test do
=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')
@ml242
ml242 / travis.rake
Created November 22, 2013 15:19 — forked from phlco/.travis.yml
namespace :travis do
desc "Prepare DB and run Tests"
task :run do
["rake db:create", "rake db:migrate RAILS_ENV=test", "rake db:seed"
"rspec spec", "rake jasmine:ci"].each do |cmd|
puts "Starting to run #{cmd}..."
system("bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
@ml242
ml242 / testing with jasmine
Last active December 28, 2015 22:19
testing with jasmine
group :development, :test do
gem 'rspec-rails'
gem 'jasmine'
gem 'pry-rails'
end
>rails g jasmine:install
>rails g rspec:install
>bundle
@ml242
ml242 / Adding Travis to A GitHub Repo
Last active December 28, 2015 21:39
Adding Travis to A GitHub Repo
Go to Travis CI
click sync now to show a recent repo
click on it to enable Travis
go to base directory and add .travis.yaml (touch .travis.yml)
in Travis:
language: ruby
@ml242
ml242 / Rspec within Rails
Last active December 28, 2015 19:29
Rspec for Rails
i.e. RAILS_ENV = (development, test, production)
Gemfile:
gem "rspec-rails", :group => [:test, :development]
gem 'jquery-rails'
development:
adapter: postgresql
@ml242
ml242 / Add Guard to a Ruby workflow
Last active December 28, 2015 17:38
Adding Rspec and Guard to a ruby project that isn't backed by Rails
go to your directory
run --> rspec --init
cd into rspec (this is where you create your helper, i.e. bus_spec.rb), or just use touch to place them
cd ..
run --> rspec spec/
run --> bundle init
add gem 'rspec'
add gem 'guard-rspec'
run --> bundle install