⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# concerns#current | |
module Current | |
extend ActiveSupport::Concern | |
... | |
def current_kase | |
@current_kase ||= Kase.find_by_id(params[:kase_id]) | |
end | |
# To include methods in views |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Users" do | |
before :each do | |
@user = FactoryGirl.create(:user) | |
end | |
it "allows users to sign in" do | |
visit login_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VendingMachine | |
# attr_accessor :money | |
def initialize(number_of_cans) | |
@cans = [] | |
number_of_cans.times do | |
@cans << 'Coke' | |
end | |
# => ['Coke', 'Coke', 'Coke', 'Coke'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b new_feature | |
...do some work... | |
git add . | |
git commit -am "did some work" | |
git push origin new_feature | |
go to github and create pull request for new_feature branch | |
- team reviews changes on github | |
- add comments, make changes, click merge pull request when accepted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="\W$GREEN\$(parse_git_branch)$NO_COLOUR\$ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nav_link(link_text, link_path) | |
class_name = current_page?(link_path) ? 'active' : '' | |
content_tag(:li, :class => class_name) do | |
link_to link_text, link_path | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails new <project name> -d postgresql --skip-bundle --skip-test-unit | |
remove turbolinks | |
1. Remove the gem 'turbolinks' line from your Gemfile. | |
2. Remove the //= require turbolinks from your app/assets/javascripts/application.js. | |
3. Remove the two "data-turbolinks-track" => true hash key/value pairs from your app/views/layouts/application.html.erb. | |
git init | |
#.gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% flash.each do |name, msg| %> | |
<div class="alert alert-<%= name == :notice ? "success" : "error" %>"> | |
<a class="close" data-dismiss="alert">×</a> | |
<%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %> | |
</div> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Settings file containing Foundation defaults | |
// Grid Settings | |
$rowWidth: 1000px !default; | |
$columnGutter: 30px !default; | |
$totalColumns: 12 !default; | |
$mobileTotalColumns: 4 !default; | |
// Colors Settings |
OlderNewer