- ⌘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 hidden or 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
events: { | |
"change input": "fieldChanged", | |
"change select": "selectionChanged", | |
}, | |
selectionChanged: function(e){ | |
var field = $(e.currentTarget); | |
var value = $("option:selected", field).val(); | |
var data = {}; | |
data[field.attr('id')] = value; |
This file contains hidden or 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
events: | |
"change input": "fieldChanged", | |
"change select": "selectionChanged", | |
selectionChanged: (event) -> | |
field = $ event.currentTarget | |
value = $("option:selected", field).val() | |
data = {} | |
data[field.attr 'id'] = value |
This file contains hidden or 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
;; emacs configuration | |
(push "/usr/local/bin" exec-path) | |
(add-to-list 'load-path "~/.emacs.d") | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
(setq-default tab-width 2) | |
(setq-default indent-tabs-mode nil) | |
(setq inhibit-startup-message t) |
This file contains hidden or 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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
This file contains hidden or 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 "Currency catalog API" do | |
let(:token) { create(:user).authentication_token } | |
before(:all) do | |
2.times { create :currency } | |
end | |
describe 'fetch the list of currencies' do |
This file contains hidden or 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 catch22 | |
model = Model.create!(:field1 => product_row[:part_number], | |
:field2 => product_row[:element_name], | |
:field3 => product_row[:pattern_value], | |
:field4 => product_row[:fixed_dp], | |
:field5 => product_row[:franchise_name], | |
:field6 => product_row[:product_code], | |
:field7 => (product_row[:volume].to_i == 0 ? nil : product_row[:volume]), | |
:field8 => product_row[:package_quantity]) | |
# other code... |
This file contains hidden or 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 sendForm() { | |
var fileData = new FormData(document.getElementById("cpd-file")); | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", "/upload_file", true); | |
xhr.setRequestHeader('Accept', 'application/json'); | |
xhr.onload = function(progressEvent) { | |
if (xhr.status == 200) { | |
console.log('Uploaded', xhr); | |
} else { |
This file contains hidden or 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
# Nginx+Unicorn best-practices congifuration guide. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
This file contains hidden or 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
brew install rbenv | |
brew install ruby-build | |
brew install rbenv-vars | |
brew install readline | |
brew install ctags | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile | |
exec $SHELL -i # reload the shell | |
CONFIGURE_OPTS="--disable-install-doc --with-readline-dir=$(brew --prefix readline)" rbenv install 1.9.3-p194 | |
rbenv global 1.9.3-p194 | |
gem install bundler rbenv-rehash git-up hitch gem-browse gem-ctags cheat awesome_print pry |