Skip to content

Instantly share code, notes, and snippets.

View rapee's full-sized avatar
🥢
Coding with chopsticks

Rapee Suveeranont rapee

🥢
Coding with chopsticks
  • Boonmee Lab
  • Bangkok, Thailand
View GitHub Profile
@rapee
rapee / slugify.js
Created July 1, 2016 09:37
Regex for multiple languages (en/th/jp)
/**
* Make slug from string.
* Support: en, th, ja
* @see https://gist.github.com/mathewbyrne/1280286
* @see http://so-zou.jp/software/tech/programming/tech/regular-expression/meta-character/variable-width-encoding.htm
* @see https://python3.wannaphong.com/2015/12/regular-expression-ภาษาไทย-และภาษาอื่น-python.html
* @return {String} Slug
*/
const whitespace_like_regex = /[\s_]+/g;
// en: a-z, A-Z, 0-9, -
@rapee
rapee / init.d.elasticsearch
Last active August 29, 2015 14:27
Install script to /etc/init.d/elasticsearch
#! /bin/bash
### BEGIN INIT INFO
# Provides: elasticsearch
# Required-Start: $all
# Required-Stop: $all
# Default-Start:
# Default-Stop: 0 1 6
# Short-Description: Starts elasticsearch
# chkconfig: - 80 15
# Description: Elasticsearch
@rapee
rapee / easy_proxy_server.sh
Last active August 29, 2015 13:57
Easy proxy server with Node
# Install bouncy globally
sudo npm install -g bouncy
# Create config file
echo '{"timetravel.boonmeelab.com":8000}' > bouncy_routes.json
# Start proxy server as background process
sudo bouncy bouncy_routes.json 80 &