Skip to content

Instantly share code, notes, and snippets.

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

Phong Phan fongfan999

🏠
Working from home
View GitHub Profile
@fongfan999
fongfan999 / install.md
Created March 15, 2017 10:17 — forked from galulex/install.md
Ruby On Rails Ubuntu 16.10 install

Developer libs

mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...

sudo apt-get install libxslt1-dev libxml2-dev build-essential patch libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs nodejs-legacy rar

Ruby

sudo apt-add-repository ppa:brightbox/ruby-ng

sudo apt-get update

@fongfan999
fongfan999 / vietnamese_sanitizer.rb
Last active September 25, 2019 10:28
Ruby script to sanitize Vietnamese "marks"
dic = {
'áàảãạăắặằẳẵâấầẩẫậ': 'a',
'ÁÀẢÃẠĂẮẶẰẲẴÂẤẦẨẪẬ': 'A',
'đ': 'd',
'Đ': 'D',
'éèẻẽẹêếềểễệ': 'e',
'ÉÈẺẼẸÊẾỀỂỄỆ': 'E',
'íìỉĩị': 'i',
'ÍÌỈĨỊ': 'I',
'óòỏõọôốồổỗộơớờởỡợ': 'o',
@fongfan999
fongfan999 / regex-o.rb
Created March 3, 2017 03:14 — forked from robmiller/regex-o.rb
Explaining Ruby regex's /o modifier
require "benchmark"
def letters
puts "letters() called"
sleep 0.5
"A-Za-z"
end
words = %w[the quick brown fox jumped over the lazy dog]
@fongfan999
fongfan999 / .htaccess
Created December 1, 2016 15:42
Enable pretty url in Yii2
RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php