Skip to content

Instantly share code, notes, and snippets.

View phamquyhai's full-sized avatar
🎯
Focusing

Pham Quy Hai phamquyhai

🎯
Focusing
View GitHub Profile
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
@phamquyhai
phamquyhai / Find and Delete node_modules.md
Last active April 26, 2021 03:29
Find and Delete node_modules in Mac/Win/Linux

#Preview

#MAC/Linux
find . -name "node_modules" -type d -prune | xargs du -chs

#WIN
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
@phamquyhai
phamquyhai / nginx.conf
Last active May 23, 2019 07:44
Config Nginx rule for Cloudflare
# Cloudflare
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
@phamquyhai
phamquyhai / mercator-latlon-to-meters.rb
Created August 24, 2018 05:11 — forked from vasrap/mercator-latlon-to-meters.rb
Lat/Lon to Meters using Mercator projection
puts "Enter latitude in decimal degrees:"
lat_deg = gets.to_f
puts "Enter longitude in decimal degrees:"
lon_deg = gets.to_f
lon_rad = (lon_deg / 180.0 * Math::PI)
lat_rad = (lat_deg / 180.0 * Math::PI)
sm_a = 6378137.0
x = sm_a * lon_rad
y = sm_a * Math.log((Math.sin(lat_rad) + 1) / Math.cos(lat_rad))
@phamquyhai
phamquyhai / redux-saga-confirmation-dialog.js
Created August 17, 2018 09:55 — forked from tomkis/redux-saga-confirmation-dialog.js
Implementing confirmation dialog via redux-saga
import { select, put, take } from 'redux-saga/effects';
function* emptySaga() {}
export function* withConfirmation(text, onConfirm, onCancel = emptySaga) {
yield put({ type: 'ShowConfirmationDialog', payload: text });
const { type } = yield take([
'ConfirmationDialogConfirmed',
'ConfirmationDialogCanceled'
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
@phamquyhai
phamquyhai / clean_cache.sh
Last active December 10, 2018 07:03
React Native Yarn Clean cache
watchman watch-del-all && \
rm -rf node_modules && \
rm -rf /tmp/metro-bundler-cache-* && \
rm -rf /tmp/haste-map-react-native-packager-* && \
yarn && yarn start --reset-cache
@phamquyhai
phamquyhai / cloudSettings
Last active October 11, 2018 14:08
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-05-25T03:20:10.584Z","extensionVersion":"v2.9.2"}
@phamquyhai
phamquyhai / haipq.pub
Created September 25, 2017 02:03
Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDoVXV2iS74Dy+QgE+2qM1/bF59ISs494BdviCGyz+uvSQ944G0Aw+wspeHnfz+7sfxbnImoZVxB5NL/NIOGItnqRjmmIJ+MpykCX1H7QczukLoBLWlJzeyo+GYnjSZxN4AEJT91oMgL/WB4PMIRGF6o6xKZLAyMqaOSQB9/uh638K+obfakQSw5g7xhcfuSdQ/PhYZttPFaPDB9FmMlHYKEqSk1jvF1D7zIBbKtmrIxBB2+wao4qOShDo7XwzYozbGjqYvaQ6SM1ypNNVQzYUJeTUWmJj562xoBsLvsmtBWq8sJhF/UfUwh5RTng42NvAvEnek+9/GZ1PLtZJTTaiz pham.quy.hai@framgia.com

How to install OpenSTF in Ubuntu 14.04

  1. Add Add RethinkDB key

     source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
     wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
    
  2. Install packages

sudo apt-get update && sudo apt-get install -y git nodejs nodejs-legacy npm rethinkdb android-tools-adb python autoconf automake libtool build-essential ninja-build libzmq3-dev libprotobuf-dev git graphicsmagick yasm stow