#Ruby on Rails Interview Questions
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
unbind C-b | |
set -g prefix C-s | |
# $Id: h-boetes.conf,v 1.2 2009-10-25 21:45:26 nicm Exp $ | |
# | |
# From Han Boetes. | |
set -g default-command zsh | |
set -g status-right "#(uptime|awk '{print $11}') #(date)" |
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
# 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/ |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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
Lesson 1 SUMMARY | |
1. The cursor is moved using either the arrow keys or the hjkl keys. | |
h (left) j (down) k (up) l (right) | |
2. To start Vim from the shell prompt type: vim FILENAME <ENTER> | |
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes. | |
OR type: <ESC> :wq <ENTER> to save the changes. |
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
# Hauleth's Rails app template | |
# Sass helpers and nicer views | |
gem 'autoprefixer-rails' | |
# Faster HTML escaping | |
gem 'escape_utils' | |
# Translations | |
gem 'r18n-rails' |
#Ruby Interview Questions
Plain old english: Ways of grouping code we want to run.
The simplest explanation for a block is that it is a chunk of code between {}
or do...end
, that can't be stored in a variable and isn't an object.
A block is just part of the syntax of a method call. It doesn’t mean anything on a standalone basis and can only appear in argument lists.
The difference is subtle, but p prints the true value of an object, rather than a string-ified version of the object. This will make more sense soon, but for the sake of simplicity, we'll use the p command throughout the exercises, as we'll want to see the true values of our code returned to the output window.
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
### Install OpenJDK | |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Download and Install ElasticSearch | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb | |
sudo dpkg -i elasticsearch-1.3.1.deb |
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
ApplicationController.allow_forgery_protection = false | |
app.post('/whatever_my_user_model_is/sign_in', {"whatever_my_user_model_is"=>{"email"=>"users@email.com", "password"=>"users_password"}}) |
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
### Get lists | |
curl -X GET http://todowiz:3000/v1/lists -H 'Authorization: Token token="c7fb3b4e268c1dfaa91c"' | |
### Update lists | |
curl -X PUT http://todowiz:3000/v1/lists/5 -H 'Authorization: Token token="13da9ded671555ef5aaa"' -d "list[permission]=private" | |
### get header information | |
curl -X GET http://todowiz:3000/v1/lists -I | |
### Create new user |