Skip to content

Instantly share code, notes, and snippets.

View raviwu's full-sized avatar

Ravi Wu raviwu

  • Taiwan
View GitHub Profile
@raviwu
raviwu / amazon_sns_wrapper.rb
Last active June 24, 2016 15:30
AmazonSnsWrapper Setup
# In Gemfile
# Include AWS SDK V1 for paperclip if your paperclip version is less than 5.0
gem 'aws-sdk-v1'
# Need to AWS V2 SDK for SNS methods, gem 'aws-sdk', '~>1.6' doesn't have Aws::SNS methods
gem 'aws-sdk', '~> 2.0'
######################################################
@raviwu
raviwu / jwt_in_rails_1_model_setup.rb
Last active June 10, 2016 02:28
Integrate JWT into Rails Grape API for Multi-Login
# Prepare the schema for the additional session records.
# XXXXXXXXXXXXXXXX_create_user_session.rb
class CreateUserSessions < ActiveRecord::Migration
def change
create_table :user_sessions do |t|
t.references :user, :foreign_key => true, :index => true, :null => false
t.text :user_agent
t.datetime :expire_at # use expire_at to control the expiration after issuing JWT
t.timestamps null: false
@raviwu
raviwu / basic_git_command.md
Last active April 25, 2017 20:59
Basic Git Commands

git init

git add . add current directory to stage

git add -A add all untrack directories and files to stage

git commit commit staged files

git checkout -b new-branch-name create new branch and checkout to new branch

@raviwu
raviwu / command_line_notes.md
Last active April 3, 2016 03:49
notes for command line tools

Basic tools

See Usage of specific command: man

man command checks out the manual for the command, for instance use man echo to see the description of the echo command.

Commen quit from mass or manufal windows

Use q to quit the manual mode, normally q works for the similar mode entered by other command like ri Array.

@raviwu
raviwu / iTerm_2_notes.md
Last active March 27, 2016 04:46
shortcuts for iTerm 2

Shortcut of iTerms2

windows and tabs

  • command + T to open new tab
  • shift + command + [ / ] to switch between tabs
  • command + W to close the tab
  • command + D to have vertical divided windows
  • command + [ / ] to switch between windows