Skip to content

Instantly share code, notes, and snippets.


Tan nhattan

  • Singapore
Block or report user

Report or block nhattan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nhattan / upload.js
Last active Dec 12, 2019
Create a blob by uploading data from a browser (ReactJS)
View upload.js
npm install @azure/storage-blob
yarn add @azure/storage-blob
Remember to set up the CORS rules for your storage
const { BlobServiceClient } = require("@azure/storage-blob")
nhattan / postman-pre-request.js
Created Jul 31, 2019 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
View postman-pre-request.js
const echoPostRequest = {
url: 'https://<my url>',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
client_id:'<your client ID>',
client_secret:'<your client secret>',
nhattan / .bashrc
Created Mar 1, 2016 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
View .bashrc
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
nhattan /
Created Feb 18, 2016
tinymce custom upload file
selector: '#my_editor',
plugins: [ 'image' ]
file_browser_callback: (field_name, url, type, win) ->
if type == 'image'
nhattan / bootstrap_and_overrides.css.less
Created Jun 26, 2015
View bootstrap_and_overrides.css.less
@import "twitter/bootstrap/bootstrap";
// Set the correct sprite paths
@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: font-url("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: font-url("fontawesome-webfont.eot?#iefix");
@fontAwesomeWoffPath: font-url("fontawesome-webfont.woff");
View gist:d419eb120ecf4defb154
Started GET "/assets/agent/twitter/fonts/glyphicons-halflings-regular.ttf" for at 2015-06-26 11:24:56 +0700
ActionController::RoutingError (No route matches [GET] "/assets/agent/twitter/fonts/glyphicons-halflings-regular.ttf"):
actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `tagged'
View gist:b1f3beb18e752088f878
# rails (4.2.0), devise (3.5.1)
# in config/environments/staging.rb
config.action_mailer.default_url_options = { host: ENV['HOSTNAME'] }
Rails.application.routes.default_url_options[:host] = ENV['HOSTNAME']
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: ENV['SMTP_SERVER'],
port: ENV['SMTP_PORT'],
user_name: ENV['SMTP_USER'],
View gist:0c208c23674a8dea883c

Solve Conflicts

Get newest code from upstream/master to your master branch

git checkout master
git pull upstream master

Checkout to current task and rebase with master branch


How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
View gist:448e346d2e6b435d16d9


  "errors": {
    "user": {
      "starting_stage_id": [
      "checklist_id": [
        "can't be blank"
You can’t perform that action at this time.