git checkout -b <branchname>
git add
git commit -m "description of changes"
| // source: http://webreflection.blogspot.com/2011/11/few-javascript-patterns.html | |
| // duck typing ( maybe all you need ) | |
| var me = {name: "WebReflection"}; | |
| // basic class | |
| function Person() {} | |
| Person.prototype.getName = function () { | |
| return this.name; | |
| }; |
| // namespace - single global variable for all news JS | |
| var news = news || {}; | |
| // Example of a singleton as a revealing module | |
| // When you only need one of something | |
| news.preferences = (function (app, global) { | |
| // Private variables | |
| var persistent = true; |
Указываем свое имя и почту
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
Делаем алиасы на команды
| # 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") |
| module PB | |
| module SocialNetwork | |
| class Twitter | |
| include PB::SocialNetwork::Base | |
| def initialize(token) | |
| @token = token | |
| end | |
| def update_profile(params = {}) |
| module PB::SocialNetwork::Base | |
| def self.included base | |
| @networks << base | |
| base.extend ClassMethods | |
| base.include InstanceMethods | |
| # другая инициализация | |
| end |
| sphinx: bundle exec rake ts:run_in_foreground |
| # Load plugins (only those I whitelist) | |
| Pry.config.should_load_plugins = false | |
| # Pry.plugins["doc"].activate! | |
| # Launch Pry with access to the entire Rails stack. | |
| # If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead. | |
| # If you don't, you can load it through the lines below :) | |
| rails = File.join Dir.getwd, 'config', 'environment.rb' | |
| if File.exist?(rails) && ENV['SKIP_RAILS'].nil? |
| # In a rails app | |
| pry(main)>.ls | |
| Capfile Gemfile.lock Rakefile config db lib public test vendor | |
| Gemfile README.md app config.ru doc log script tmp |