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
@xemoe
xemoe / start.sh
Last active August 29, 2015 14:14
Kylemanna/docker-openvpn helper script
#!/bin/bash
#################################
## Boostrap and Initial parameters
#################################
# Require realpath
type realpath;
if [ $? -eq 1 ]; then
echo "realpath command not found, wait for install"
sudo apt-get update && sudo apt-get install realpath -y;
@xemoe
xemoe / authen_acl_recipes.md
Last active August 29, 2015 14:18
User authentication & authorized

Testcase

Authentication

  1. Guest can access login form and see form
  2. Guest cannot access forbidden area and redirect to login form
  3. Customer user can login and see logout link

Authorized

  1. Logged in user can access profile page
  2. Customer role cannot access admin form
  3. Admin role can access admin form
@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
@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 / 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 / .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 / 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 / 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 / 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 / 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