Skip to content

Instantly share code, notes, and snippets.

View narze's full-sized avatar
🕺
You know the rules, and so do I

Manassarn "Noom" Manoonchai narze

🕺
You know the rules, and so do I
View GitHub Profile
@narze
narze / restart.sh
Created April 12, 2016 08:39
1-liner restart process if killed
until some_command; do echo "Process crashed with exit code $?. Respawning.." >&2; sleep 1; done
@narze
narze / gist:a40a527de04d5af1c6b16545fc584e80
Last active May 11, 2016 08:09
Fix error libv8 & therubyracer
# Try bundle install first, and wait it fail :/
gem uninstall libv8
gem uninstall therubyracer
brew rm v8
brew tap homebrew/versions
brew install v8-315
brew link --force v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8 # Replace version number
@narze
narze / .laptop.local
Created May 11, 2016 06:32
(new) laptop.local
#!/bin/sh
brew bundle --file=- <<EOF
cask_args appdir: '/Applications'
tap 'caskroom/cask'
tap 'caskroom/versions'
cask 'google-chrome'
cask 'dash'
cask 'github'

Keybase proof

I hereby claim:

  • I am narze on github.
  • I am narze (https://keybase.io/narze) on keybase.
  • I have a public key whose fingerprint is 7639 959A 545B 48DC BB81 59CD A63C 68B9 F706 7B2B

To claim this, I am signing this object:

@narze
narze / filter_in_file.exs
Created November 29, 2016 17:37
Filter words with specified characters in a file
# Filter words with specified characters in a file
# Usage : `filter_in_file("thai.txt", "ทงกานเ")`
def filter_in_file(filename, chars) do
File.read!(filename)
|> filter(chars)
end
def filter(words, chars) do
words

Keybase proof

I hereby claim:

  • I am narze on github.
  • I am narze (https://keybase.io/narze) on keybase.
  • I have a public key ASDIEOC5N9JBj1M07l_j1iBDPkr6ZpTBxMiZk2sOSr1iAgo

To claim this, I am signing this object:

@narze
narze / Places.kml
Last active November 13, 2017 05:49
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Temporary Places.kml</name>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Temporary Places.kml</name>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
@narze
narze / gist:e83f23dacfee406222e58ed9b3093108
Created June 21, 2018 11:29
Self-signed certificate SSL with puma on localhost
# Self sign
openssl req -x509 -out tmp/localhost.crt -keyout tmp/localhost.key \  ✔  6930  18:25:32 
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
# Run puma directly instead of bin/rails server
bundle exec puma -b 'ssl://localhost:3000?key=tmp/localhost.key&cert=tmp/localhost.crt'
@narze
narze / .sVimrc
Created October 10, 2018 10:36 — forked from TSFoster/.sVimrc
.sVimrc
let scrollstep = 100
let hintcharacters = "asdfjkl"
let homeurl = "about:blank"
let mapleader = "space"
let blacklists = ["*://www.fastmail.com/*","*://mail.google.com/*","*://docs.google.com/*","*://*feedbin.com/*","*://www.babbel.com/*","*://*trello.com/*","*://www.codewars.com/*","*://www.shortcutfoo.com/*","*://getpocket.com/*","*://*netflix.com/*","*://app.youneedabudget.com/*", "*://codepen.io/*","*://duckduckgo.com/*","*://www.youtube.com/watch?*","https://ellie-app.com/*"]