Skip to content

Instantly share code, notes, and snippets.

View nguyentienlong's full-sized avatar
💭
I may be slow to respond.

lk nguyentienlong

💭
I may be slow to respond.
  • Vietnam
View GitHub Profile
@nguyentienlong
nguyentienlong / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nguyentienlong
nguyentienlong / NERDTree.mkd
Created January 24, 2016 07:13 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@nguyentienlong
nguyentienlong / introrx.md
Created February 25, 2016 03:41 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@nguyentienlong
nguyentienlong / nginx
Created February 28, 2016 07:54 — forked from pzorn/nginx
php-fpm and nginx init.d script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@nguyentienlong
nguyentienlong / install_mysql.sh
Created May 27, 2016 00:04 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@nguyentienlong
nguyentienlong / expand_array.php
Created September 20, 2016 13:46 — forked from adhocore/expand_array.php
A helper function expand_array for PHP
<?php
/**
* A helper function expand_array for PHP
*
* This is actually developed during the real need to develop JSON api
* I wanted to have JSON api response spitted properly expanded (with semantic nodes)
* But didnot want to do it by playing with arrays (looping, merging n' what not) time and again.
* So, After fetching single dimensional array data from database, with keys having
* some specific delimeter, this helper would do for me what i want to.
@nguyentienlong
nguyentienlong / index.html
Created October 5, 2016 16:41 — forked from mbajur/index.html
Working example of window.postMessage used for sending data from popup to parent page (works in IE)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
<script type="text/javascript">
window.open ("popup.html","mywindow", "width=350,height=250");
// Create IE + others compatible event handler
@nguyentienlong
nguyentienlong / music.md
Created February 20, 2017 02:14 — forked from staltz/music.md
coding music

Not for everyone. Each programmer has their own appreciation of what is good coding music.

For when I need to think deep, debug something, or design

(From most influential to least)

@nguyentienlong
nguyentienlong / autoConvert.sh
Created September 30, 2017 04:07 — forked from goliver79/autoConvert.sh
[LINUX] Convert MP4 to MP3
#!/bin/bash
for f in *.mp4
do
echo "Converting $f"
name=`echo "$f" | sed -e "s/.mp4$//g"`
ffmpeg -i "$f" -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 "$name.mp3"
done