Skip to content

Instantly share code, notes, and snippets.

View yihyang's full-sized avatar
😰
kinda busy

Yih Yang yihyang

😰
kinda busy
View GitHub Profile
@yihyang
yihyang / rbenv-install.sh
Last active January 23, 2016 16:50 — forked from vincentlkl/rbenv-install.sh
Setting up guide on Microsoft Azure
# TO DO when there is warning message on locales
sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
export LC_ALL="en_US.UTF-8"
# Update, upgrade and install development tools:
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential git-core libssl-dev libsqlite3-dev curl nodejs nginx libreadline-dev rbenv
@yihyang
yihyang / git_advanced_cheat_sheet
Created September 21, 2015 04:18
Cheat Sheets for git (Advanced)
# Checkout previous commit and saves it into a branch
git checkout -b <new_branch_name> <commit code>
## Comparing modified file in single line between branches
# This one shows in "M abc.html" format
git diff --name-status master..branchName
# This one shows in "Gemfile.lock | 39 +----" format
git diff --stat --color master..branchName
@yihyang
yihyang / gems.txt
Last active November 7, 2015 07:33
Collection of gems that which I think is quite useful...
## User Management - (authentication, login / logout, signup, etc...)
gem 'devise'
## Autocomplete
# autocomplete 'https://github.com/bigtunacan/rails-jquery-autocomplete'
gem 'rails4-autocomplete'
# elasticsearch 'https://github.com/elastic/elasticsearch-rails'
gem 'elasticsearch-model', git: 'git://github.com/elasticsearch/elasticsearch-rails.git'
gem 'elasticsearch-rails', git: 'git://github.com/elasticsearch/elasticsearch-rails.git'
@yihyang
yihyang / psql.txt
Last active January 25, 2016 08:04
Commonly used psql commands
# Show all users
\du
# List all the databases
\l
\list
# Connect to database
\c <database_name>
\connect <database_name>
@yihyang
yihyang / deploy_rails_configuration.txt
Created September 22, 2015 16:22
Steps to configure in order to configure rails application for deployment
1. Add production database settings in 'config/database.yml'
@yihyang
yihyang / deploy.rb
Created September 24, 2015 05:39
Rails capistrano deployment file: config/deploy.rb
# File location: config/deploy.rb
# Change these
server 'server_address', port: ssl_port_number, roles: [:web, :app, :db], primary: true
set :repo_url, 'git@bitbucket.org:user/some-repository.git'
set :application, 'app_name'
set :user, 'user_name'
set :puma_threads, [4, 16]
set :puma_workers, 0
@yihyang
yihyang / javascript library
Last active November 16, 2015 04:09
Useful Javascript Libraries
http://masonry.desandro.com/
# handsontable - edit excel table using HTML + JS
https://github.com/handsontable/handsontable
# raphaeljs - generate Powerpoint-like graphs
http://g.raphaeljs.com/
# numeraljs - formatting numbers and etc
http://numeraljs.com/
@yihyang
yihyang / Components ASP.NET (C#)
Created November 16, 2015 02:03
Advanced ASP.NET Component
# Advanced components that existed within ASP.NET
- UserControl -> User containers that can add markup / Web Server Control
Can treat the user control as a unit and define properties and methods for it
(https://msdn.microsoft.com/en-us/library/fb3w5b53.aspx)
- TreeView -> Provide tree like way of presenting information in ASP.NET
Typically used as navigation component.
(Using Web.sitemap / XMLDataSource)
(http://www.aspnetbook.com/basics/asp-net-treeview-control.php)
# for loop to process fop
for f in examples/fo/basic/*.fo; do ./fop $f ${f%%.fo}.pdf; done
@yihyang
yihyang / ionic
Last active January 25, 2016 08:17
ionic start <myapp> <tabs/sidemenu/blank> # Create a new app
ionic serve # Run on browser (default on ios)
ionic server --lab # Run on browser (ios & android side by side)
ionic platform add ios # Add ionic as platform
ionic build ios # Build the application for ios
ionic emulate ios # Emulate the application on ios