Skip to content

Instantly share code, notes, and snippets.

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

Kamontat Chantrachirathumrong kamontat

💭
I may be slow to respond.
View GitHub Profile
# This is Git's per-user configuration file.
[user]
name = Kamontat Chantrachirathumrong
# email = developer@kamontat.net
email = kamontat.chantrachirathumrong@agoda.com
# signingKey = 705CB6B32BBCBABA
signingKey = DD18B41623EB11D1
[alias]
com = commit
@kamontat
kamontat / README.md
Last active April 2, 2020 14:03
COLOR CONSTANTS (BASH)

Develop

  1. clone this project by git clone https://gist.github.com/717f75e6b87606940017adf385274044.git color
  2. run cd color
  3. write the code as what you want
    • color_constants.sh - new version of constant (using tput)
    • color_raw_constants.sh - old version of constant (using raw text to assign)
      • some terminal app, might miss the color.
    • install.sh - install color script

Run

@kamontat
kamontat / helper.sh
Last active June 16, 2019 05:37
helper method for bash scripts
#!/usr/bin/env bash
# shellcheck disable=SC1000
# generate by create-script-file v4.0.1
# link (https://github.com/Template-generator/create-script-file/tree/v4.0.1)
# set -x #DEBUG - Display commands and their arguments as they are executed.
# set -v #VERBOSE - Display shell input lines as they are read.
# set -n #EVALUATE - Check syntax of the script but don't execute.
@kamontat
kamontat / convert.py
Created February 18, 2019 07:26
convert facebook information encode to correct one (only appear when export as JSON)
import json
def parse_obj(obj):
for key in obj:
if type(obj[key]) is str:
obj[key] = obj[key].encode('latin_1').decode('utf-8')
elif type(obj[key]) is list:
obj[key] = list(map(lambda x: x if type(x) != str else x.encode('latin_1').decode('utf-8'), obj[key]))
pass
return obj
@kamontat
kamontat / random.sh
Created October 2, 2018 04:26
random group for Prof. Somnuk subject in Kasetsart University
#!/usr/bin/env bash
# shellcheck disable=SC1000
# generate by v3.0.2
# link (https://github.com/Template-generator/script-genrating/tree/v3.0.2)
# set -x #DEBUG - Display commands and their arguments as they are executed.
# set -v #VERBOSE - Display shell input lines as they are read.
# set -n #EVALUATE - Check syntax of the script but don't execute.
#!/usr/bin/env bash
# shellcheck disable=SC1000
# generate by v3.0.2
# link (https://github.com/Template-generator/script-genrating/tree/v3.0.2)
# set -x #DEBUG - Display commands and their arguments as they are executed.
# set -v #VERBOSE - Display shell input lines as they are read.
# set -n #EVALUATE - Check syntax of the script but don't execute.
#!/usr/bin/env bash
# shellcheck disable=SC1000
# generate by v3.0.2
# link (https://github.com/Template-generator/script-genrating/tree/v3.0.2)
# set -x #DEBUG - Display commands and their arguments as they are executed.
# set -v #VERBOSE - Display shell input lines as they are read.
# set -n #EVALUATE - Check syntax of the script but don't execute.
@kamontat
kamontat / setup.bash
Created August 30, 2018 17:03
Restart Setup, To recreate Admin user in MacOS
# Shutdown your computer (Mac)
# Press `Command+S` and turn computer on.
# Press, until computer open black screen
## Type below to the screen
# Mount root dir
/sbin/mount -uw /
# remove setup entry
rm /var/db/.applesetupdone
#!/bin/bash
# <bitbar.title>command shortcut</bitbar.title>
# <bitbar.version>v1.1</bitbar.version>
# <bitbar.since>9 Mar 2018</bitbar.since>
# <bitbar.author>kamontat</bitbar.author>
# <bitbar.author.github>kamontat</bitbar.author.github>
# <bitbar.desc>Show setting shortcut keys</bitbar.desc>
# <bitbar.dependencies>bash</bitbar.dependencies>