Skip to content

Instantly share code, notes, and snippets.

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

Teerapong Ladlee xemoe

🏠
Working from home
  • Bangkok, Thailand
View GitHub Profile
spinner()
{
    local pid=$1
    local delay=0.75
    local spinstr='|/-\'
    while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
        local temp=${spinstr#?}
        printf " [%c]  " "$spinstr"
 local spinstr=$temp${spinstr%"$temp"}
@xemoe
xemoe / explain.md
Last active August 29, 2015 14:22
Redirect stdout/stderr
@xemoe
xemoe / ubuntu_install_py_pip.md
Created May 29, 2015 10:30
Ubuntu 14.04 install python pip

Install python-pip

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && sudo python get-pip.py
@xemoe
xemoe / php_ini.md
Created May 28, 2015 16:00
PHP Error: Maximum function nesting level of '100' reached, aborting

Add this line to php.ini

xdebug.max_nesting_level=200
@xemoe
xemoe / sublime_text_3_tweak_and_shortcuts.md
Created May 23, 2015 15:17
Sublime Text 3 Tweaks and Shortcuts

Search files in Project

CTRL+P

Find and replace multiple

CTRL+D
@xemoe
xemoe / 0_reuse_code.js
Last active August 29, 2015 14:21
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
@xemoe
xemoe / .tmux.conf
Last active August 29, 2015 14:20
Tmux colors
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
set-option -g default-shell /bin/zsh
set-option -g set-titles on
@xemoe
xemoe / gulpfile.js
Last active August 29, 2015 14:20 — forked from WISHPRO/gulpfile.js
// paths
var combine_dir = 'resources/assets';
var build_dir = 'resources/assets/build';
var less_file = 'main';
var less_output = combine_dir + '/css';
// set scripts to combine
var scripts = [
'vendor/jquery/jquery.js',
'js/main.js'
@xemoe
xemoe / 0_l5_guide.md
Last active November 2, 2019 13:52
Larvel 5 bootstrap guide

ติดตั้ง Laravel 5 installer

composer global require "laravel/installer=~1.1"

สร้าง Laravel 5 application

~/.composer/vendor/bin/laravel new myapp
@xemoe
xemoe / apache_basic
Created May 7, 2015 05:38
Apache basic authen
# Create htpasswd
htpasswd -c ${filename} ${username}
# Create htaccess file
AuthUserFile ${filename}
AuthType Basic
AuthName "${message}"
Require valid-user