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
| #Session controller provides a token | |
| #/controllers/api/sessions_controller.rb | |
| class Api::SessionsController < Devise::SessionsController | |
| before_filter :authenticate_user!, :except => [:create] | |
| before_filter :ensure_params_exist, :except => [:destroy] | |
| respond_to :json | |
| def create | |
| resource = User.find_for_database_authentication(:email => params[:user_login][:email]) | |
| return invalid_login_attempt unless resource |
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
| class Api::RegistrationsController < Api::BaseController | |
| respond_to :json | |
| def create | |
| user = User.new(params[:user]) | |
| if user.save | |
| render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
| return | |
| 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
| { | |
| "order": { | |
| "id": 337, | |
| "status": "pending", | |
| "created_at": "2013-09-20T11:23:01Z", | |
| "subtotal": 5.0, | |
| "order_type": "delivery", | |
| "restaurant": { | |
| "id": 2, | |
| "name": "Name1" |
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() { | |
| $("#profile_skill_list").tokenInput("/skills/all.json", { | |
| crossDomain: false, | |
| prePopulate: $("#profile_skill_list").data("pre"), | |
| noResultsText: 'No result, hit space to create a new skill tag', | |
| }); | |
| }); |
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
| # Open termnal and type | |
| $ xcode-select --install | |
| # a pop-up window will appear asking you to install tools - go for it. | |
| # you're done here. |
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
| _._ | |
| _.-``__ ''-._ | |
| _.-`` `. `_. ''-._ Redis 2.6.16 (00000000/0) 64 bit | |
| .-`` .-```. ```\/ _.,_ ''-._ | |
| ( ' , .-` | `, ) Running in stand alone mode | |
| |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | |
| | `-._ `._ / _.-' | PID: 26703 | |
| `-._ `-._ `-./ _.-' _.-' | |
| |`-._`-._ `-.__.-' _.-'_.-'| | |
| | `-._`-._ _.-'_.-' | http://redis.io |
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
| { | |
| "profile": { | |
| "id": 8, | |
| "user_id": 2, | |
| "full_name": "Test User", | |
| "image": "", | |
| "age": 49, | |
| "gender": "", | |
| "mobile_number": "01121212121", | |
| "orientation": "", |
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
| lsblk | |
| xvdb 202:16 0 15G 0 disk | |
| xvda1 202:1 0 8G 0 disk / | |
| sudo mkfs.ext4 /dev/xvdb | |
| sudo mkdir /mnt/tmp | |
| sudo mount /dev/xvdb/ /mnt/tmp |
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
| Make symbolic link to ini files in mods-available | |
| sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini | |
| Enable mods | |
| sudo php5enmod mcrypt | |
| Restart FPM | |
| sudo service php5-fpm restart |
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
| $ sudo add-apt-repository ppa:webupd8team/java | |
| $ sudo apt-get update | |
| $ sudo apt-get install oracle-java7-installer | |
| $ java -version | |
| java version "1.7.0_51" | |
| Java(TM) SE Runtime Environment (build 1.7.0_51-b13) | |
| Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) |