Skip to content

Instantly share code, notes, and snippets.

View hnq90's full-sized avatar
🎯
Focusing

Huy Nguyen Quang hnq90

🎯
Focusing
View GitHub Profile
@hnq90
hnq90 / YubinBango.js
Last active August 30, 2017 07:35
ES6 YubinBango
/**
* 郵便番号自動入力クラス
* YubinBango
*
* [SOURCE]
* https://github.com/kobabasu/micro-flux
*
* [LATEST VERSION]
* https://gist.github.com/hnq90/1c63e82377b5cac9ec0ed7a1d93269d2
*
export MIRROR_SOURCE=https://registry.hub.docker.com
export MIRROR_SOURCE_INDEX=https://registry.hub.docker.com
“This is your life. Do what you love, and do it often.” Holstee Manifesto
“Overthinking ruins you. Ruins the situation, twists it around, makes you worry and just makes everything much worse than it actually is.” Unknown
“Don't let the noise of others' opinions drown out your own inner voice. Have the courage to follow your own heart and intuition.” Steve Jobs
“The greatest mistake you can make in life is to be continually fearing you will make one.” Elbert Hubbard
“Don't let someone who gave up on their dreams talk you out of going after yours.” Zig Ziglar
“The secret to happiness is freedom. And the secret to freedom is courage.” Thucydides
“Courage doesn't always roar. Sometimes courage is the quiet voice at the end of the day whispering, 'I will try again tomorrow.'” Mary Anne Radmacher
“Sometimes life hits you in the head with a brick. Don't lose faith.” Steve Jobs
“The journey is the reward.” Steve Jobs
“If you find yourself constantly trying to prove your worth to someone, you have already forgotten yo
@hnq90
hnq90 / .tmux.conf
Last active December 29, 2016 07:08
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# solve the arrows mess when using vim in tmux
set -g default-terminal "xterm-256color"
# use mouse to scroll the output page instead of the command history
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
@hnq90
hnq90 / .bashrc
Created November 21, 2016 07:17
Weather
function weather() {
local LOCATION=${1-"Hanoi"}
curl wttr.in/$LOCATION
}
window.top == window && window.console && (window.console.log("%c%s", "color: red; background: yellow; font-size: 24px;", "WARNING!"),
window.console.log("%c%s", "color: black; font-size: 18px;", "Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS.\nDo not enter or paste code that you do not understand."))
@hnq90
hnq90 / jsfuck.js
Last active October 11, 2016 09:44
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][[]]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+([![]]+[][[
@hnq90
hnq90 / git-export.md
Created March 30, 2016 04:34 — forked from vanquang9387/git-export.md
git: export diff files between 2 branches/commits

We can get list of changed files between 2 branches/commits by

$ tar --ignore-failed-read -vczf archive.tgz $(git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT master develop)

Let's see important part:

  1. git diff-tree -r $commit_id:
    Take a diff of the given commit to its parent(s) (including all subdirectories, not just the top directory).
@hnq90
hnq90 / nginx-custom-build.sh
Created March 25, 2016 10:48
Build Ubuntu or Debian packages for nginx with custom patches, configs, and name suffixes in one command
#!/bin/bash
# Author: Alexander Rodin <rodin.alexander@gmail.com>
# License: MIT
BUILD_DIR=build
while getopts "hp:s:r:b:o:c:n" opt; do
case $opt in
h)
echo "Usage: $0 [options]"
@hnq90
hnq90 / vm-resize-hard-disk.md
Created March 17, 2016 09:42 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where: