Skip to content

Instantly share code, notes, and snippets.

View alvinlai's full-sized avatar

Alvin Lai alvinlai

  • Mountain View, CA
View GitHub Profile
@alvinlai
alvinlai / gist:9082523
Created February 18, 2014 23:13
mysql homebrew
gem install mysql2 -v 0.3.15 -- --with-mysql-config=/usr/local/Cellar/mysql55/5.5.30/bin/mysql_config
@alvinlai
alvinlai / bash_horizontal_line.sh
Created February 10, 2014 20:53
bash horizontal line
# Put this in your ~/.bash_profile
function hr {
if [[ -n $1 ]]; then
space_character=$1
else
space_character='='
fi
@alvinlai
alvinlai / public.pem
Created December 4, 2013 05:16
test pubkey
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAon10gBWBgBvj3k9M2dLz
h1wSr0aeiX2Fs+Bx+e2T5JG/NQRaBiQBtMESCN+c0dldrgo/72Ayj/phOjW7CGNN
vpvCC/zzbnfSoT8NJQqiTw34OmuCOvMDiuCRpIe8Y9tdLJxIJP4gxDyPL7b4Ml5T
TaSpcuaGCbDYlRIY2N1tj0q8qFRxumXMemxcvHy2+IPURyVmRKGKyCKNVs8D6sy9
d1cKBEE+ddIKYOA4R8ByghdxhLLhRyqRMsIdw0ON0GtYjQiPRMjHfvsJSOVFpZnT
FgLE+0WCeWEA2RhSvMOfD7hU2N1jgXnOZf5dGAiQ6YJc7TYdvdZ5IOqI/xMFDut2
Ng3SuKDkFhUEQBSsoC4yXUiwDjdQJzBgnTXF/RLh2mqkd9v7NfdTIaPlYvWB4f5D
gNzpoCEqQKHiJVBI758WrFw1+C+IrbY5ZRN5vhvGsDso2NlwvQyrbMB8AafaZI/5
cDBNwOFtn+B3dXS84y7+Pg1zQwEzQ+Ctkg8tS7TCAVvfJICj1TMtp+dDeNkqXGHg
@alvinlai
alvinlai / Gemfile
Last active December 30, 2015 02:39
makermail Gemfile for Docker
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
@alvinlai
alvinlai / Gemfile
Last active December 28, 2015 06:48
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
@alvinlai
alvinlai / Gemfile
Created November 10, 2013 18:36
Gemfile for dockernotes
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
$('.settings li select:has(option[value=never])').val('never');
@alvinlai
alvinlai / gist:6945967
Created October 12, 2013 04:52
duck.md

A woman brought a very limp duck into a veterinary surgeon. As she laid her pet on the table, the vet pulled out his stethoscope and listened to the bird's chest. After a moment or two, the vet shook his head and sadly said, "I'm sorry, your duck, Cuddles, has passed away." The distressed woman wailed, "Are you sure?" "Yes, I am sure. Your duck is dead," replied the vet.. "How can you be so sure?" she protested. "I mean you haven't done any testing on him or anything. He might just be in a coma or something." The vet rolled his eyes, turned around and left the room. He returned a few minutes later with a black Labrador Retriever. As the duck's owner looked on in amazement, the dog stood on his hind legs, put his front paws on the examination table and sniffed the duck from top to bottom. He then looked up at the vet with sad eyes and shook his head. The vet patted the dog on the head and took it out of the room. A few minutes later he returned with a cat. The cat jumped on the table and also delicately sniffe

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';