Skip to content

Instantly share code, notes, and snippets.

View ntamvl's full-sized avatar
🏠
Working from home

Tam Nguyen ntamvl

🏠
Working from home
View GitHub Profile
@ntamvl
ntamvl / phantomjs.md
Created October 3, 2015 04:34 — forked from dominicsayers/phantomjs.md
Installing PhantomJS on Ubuntu

(updated version of http://www.joyceleong.com/log/installing-phantomjs-on-ubuntu/)

  1. export P=phantomjs-1.9.8-linux-x86_64
  2. cd /usr/local/share
  3. sudo wget https://bitbucket.org/ariya/phantomjs/downloads/$P.tar.bz2
  4. sudo tar xvf $P.tar.bz2
  5. sudo ln -s /usr/local/share/$P /usr/local/share/phantomjs
  6. sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
  7. phantomjs --version
@ntamvl
ntamvl / 00.howto_install_phantomjs.md
Created October 3, 2015 04:34 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

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
@ntamvl
ntamvl / LoopBack Replication & Offline sync.md
Last active February 21, 2024 11:18 — forked from bajtos/text.md
LoopBack Replication & Offline sync

The offline data access & synchronization is built from three components:

  1. Change tracking
  2. Replication of changes
  3. Browser version of LoopBack

Setup

Enable change tracking

@ntamvl
ntamvl / FileController.js
Created October 9, 2015 04:46 — forked from tkh44/FileController.js
Simple file upload for sails.js
module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};
@ntamvl
ntamvl / restaurants.js
Created October 13, 2015 05:16 — forked from soltrinox/restaurants.js
Loopback : Model access non-related model via App object
'use strict';
var app = require('../../server/server');
module.exports = function(Restaurant, app) {
// Restaurant.validatesUniquenessOf('UUID', {message: 'UUID EXISTS'});
Restaurant.observe('before save', function setDefaultUsername(ctx, next) {
if (ctx.instance) {
if(!ctx.instance.created){
ctx.instance.created = Date.now();
@ntamvl
ntamvl / mysql2-gem-install.sh
Created November 3, 2015 08:50 — forked from roolo/mysql2-gem-install.sh
Fixing "Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10. (RuntimeError)" on OS X while using Brew
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config
@ntamvl
ntamvl / tmux-cheatsheet.markdown
Created November 4, 2015 17:00 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ntamvl
ntamvl / nginx
Created December 10, 2015 07:27 — forked from hisea/nginx
ubuntu passenger nginx init.d script
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
@ntamvl
ntamvl / Deep_Symbolization
Last active February 21, 2024 11:17 — forked from morhekil/LICENSE
Implementation of deep symbolization of keys for Ruby hashes
The MIT License (MIT)
Copyright (c) 2015 Oleg Ivanov http://github.com/morhekil
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ntamvl
ntamvl / digital_ocean_setup.md
Created December 15, 2015 16:45 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password