Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
=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 / 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
@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'
# 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

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
@ml242
ml242 / gist:9121573
Created February 20, 2014 19:39 — forked from panuta/gist:1852087

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action
#Deep Sleep Off
sudo pmset -a hibernatemode 0
# Airdrop On
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1