Skip to content

Instantly share code, notes, and snippets.

View phamquyhai's full-sized avatar
🎯
Focusing

Pham Quy Hai phamquyhai

🎯
Focusing
View GitHub Profile
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
@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'
@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 / 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 / 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"
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4