Skip to content

Instantly share code, notes, and snippets.

View hungryzi's full-sized avatar

Zi Huong Vu hungryzi

  • Vancouver, Canada
View GitHub Profile
@hungryzi
hungryzi / secret_token.rb
Created August 25, 2013 09:52
Load secret_token from ENV
secret = ENV['SECRET_TOKEN']
if secret.length < 30
raise "Secret token cannot be loaded"
else
Rails.application.config.secret_token = secret
end
@hungryzi
hungryzi / phpunit.rb
Last active December 24, 2015 15:59 — forked from itspriddle/phpunit.rb
require 'formula'
class Phpunit < Formula
homepage 'http://www.phpunit.de/manual/current/en/index.html'
url 'https://phar.phpunit.de/phpunit.phar'
sha1 'dc693b34a62644f61cfc01a22d9654ff4b8764af'
version 'HEAD'
def install
bin.install "phpunit.phar" => "phpunit"
@hungryzi
hungryzi / Cheffile
Last active December 30, 2015 05:39
site "http://community.opscode.com/api/v1"
cookbook "pivotal_workstation" , :git => "https://github.com/pivotal/pivotal_workstation"
cookbook "neo_workstation" , :git => "https://github.com/neo/neo_workstation"
@hungryzi
hungryzi / gist:4e38404f04f4647355c3
Last active August 29, 2015 14:05
Paypal integration

Sandbox Setup

PayPal

Go to PayPal's Developer Website, sign in with your PayPal account, click "Applications" then "Sandbox Accounts" and create a new "Business" account. Once the account is created, click on the triangle next to its email address, then "Profile". The "API Credentials" tab will provide your API credentials (probably). If this tab is blank, try refreshing the page.

You will also need a "Personal" account to test the transactions on your site. Create this in the same way, finding the account information under "Profile" as well. You may need to set a password in order to be able to log in to PayPal's sandbox for this user.

Spree Setup

@hungryzi
hungryzi / README.md
Last active November 17, 2016 22:33
Vietname population density by provinces/cities

Visualizing Vietname population density by provinces/cities.

Sex ratio at birth in Vietnam

@hungryzi
hungryzi / download_all.js
Created January 30, 2015 04:42
Download All snippet
var links = document.getElementsByTagName('a')
var map = [].map
var hrefs = map.call(links, function(l) {return l.href})
hrefs = hrefs.filter(function(h){ return h.match('mobi')})
for (var i=100; i < 300; i++) {
window.open(hrefs[i])
}
date category employee name employee address expense description pre-tax amount tax name tax amount
12/1/2013 Travel Don Draper 783 Park Ave, New York, NY 10021 Taxi ride 350.00 NY Sales tax 31.06
11/0/2013 Meals and Entertainment Eric Schmidt 1600 Amphitheatre Parkway, Mountain View, CA 94043 Coffee with Steve 300.00 CA Sales tax 22.50
9/30/2013 Office Supplies Larry Page 1600 Amphitheatre Parkway, Mountain View, CA 94043 Paper 200.00 CA Sales tax 15.00
@hungryzi
hungryzi / onboarding.md
Last active May 9, 2017 18:10
Engineers onboarding
@hungryzi
hungryzi / .vimrc
Created September 14, 2017 13:21
.vimrc
" It's Vim - not Vi
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
" required!
Plugin 'VundleVim/Vundle.vim'