start new:
tmux
start new with session name:
tmux new -s myname
| ### | |
| Usage: | |
| * add model.name property that will be used as a namespace in the json request | |
| * put this code before your Backbone app code | |
| * use toJSON() as usual (so there is no namespacing in your templates) | |
| * your model's data will be sent under model.name key when calling save() | |
| ### | |
| # save reference to Backbone.sync | |
| Backbone.oldSync = Backbone.sync |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| # config/initializers/paperclip.rb | |
| ####################################### | |
| RACKSPACE_CONFIG = { | |
| 'production' => { | |
| path: '', | |
| storage: :fog, | |
| fog_credentials: { | |
| provider: 'Rackspace', | |
| rackspace_username: ENV['RACKSPACE_USERNAME'], |
| sudo su postgres | |
| psql | |
| update pg_database set datistemplate=false where datname='template1'; | |
| drop database Template1; | |
| create database template1 with owner=postgres encoding='UTF-8' | |
| lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0; | |
| update pg_database set datistemplate=true where datname='template1'; |
| class ControllerTestCase < ActionController::TestCase | |
| include Devise::TestHelpers | |
| include Warden::Test::Helpers | |
| def setup | |
| Warden.test_mode! | |
| self.do_setup | |
| end |
| ======= Prolbem ================================================================================================================= | |
| I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute: | |
| rake db:create , command I get: | |
| PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) | |
| HINT: Use the same encoding as in the template database, or use template0 as template. | |
| : CREATE DATABASE "my_db_name" ENCODING = 'unicode'....... | |
| bin/rake:16:in `load' |
| # NullStorage provider for CarrierWave for use in tests. Doesn't actually | |
| # upload or store files but allows test to pass as if files were stored and | |
| # the use of fixtures. | |
| class NullStorage | |
| attr_reader :uploader | |
| def initialize(uploader) | |
| @uploader = uploader | |
| end |