Skip to content

Instantly share code, notes, and snippets.

View tuannh99's full-sized avatar

Tuan Nguyen Huy tuannh99

View GitHub Profile
@tuannh99
tuannh99 / YAML.sublime-settings.md
Last active October 24, 2019 03:33
[OSX] Make Sublime Text 3 default open specified file extension in a specified syntax

$ cat "/Users/YOURUSER/Library/Application Support/Sublime Text 3/Packages/User/YAML.sublime-settings"

{
	"extensions":
	[
		"yml.j2"
	]
}
@tuannh99
tuannh99 / keybase.md
Created July 23, 2019 07:53
keybase proving

Keybase proof

I hereby claim:

  • I am tuannh99 on github.
  • I am tnguyen9 (https://keybase.io/tnguyen9) on keybase.
  • I have a public key ASBqT-Tv0jYPrG_a8RUbrFcKdJBQ6XvJmTcmW8qiPSwodgo

To claim this, I am signing this object:

@tuannh99
tuannh99 / multiple_ssh_config.md
Last active September 25, 2019 06:01
Multiple SSH keys for different github accounts

Multiple SSH Keys config for different github accounts

SSH keys

Suppose we have 3 SSH keys

  • ~/.ssh/id_rsa
  • ~/.ssh/id_rsa_sky
  • ~/.ssh/id_rsa_heart
@tuannh99
tuannh99 / create_database_interactively.sh
Created November 25, 2015 10:51
Create database & database user interactively
#!/bin/bash
#Ask user to enter database name and save input to dbname variable
read -p "Please Enter Database Name:" dbname
#Create database
Q1="CREATE DATABASE IF NOT EXISTS $dbname;"
#if database exist:
if [ $? -eq 0 ]; then
var system = require('system');
// Control the script arguments
if (system.args.length < 2 || system.args.length > 2) {
console.log("Invalid arguments");
phantom.exit();
}
console.log("===== VIDEO URL: " + system.args[1])
var page = new WebPage(),