Skip to content

Instantly share code, notes, and snippets.

View phamquyhai's full-sized avatar
🎯
Focusing

Pham Quy Hai phamquyhai

🎯
Focusing
View GitHub Profile
@ptenteromano
ptenteromano / photos.tsx
Last active March 28, 2024 10:42
Infinite Scroll with Remix Run
/*
* Infinite Scroll using Remix Run
* Based on client-side Scroll position
* Full Article here: https://dev.to/ptenteromano/infinite-scroll-with-remix-run-1g7
*/
import { useEffect, useState, useCallback } from "react";
import { LoaderFunction, useLoaderData, useFetcher } from "remix";
import { fetchPhotos } from "~/utils/api/restful";
import type { PhotoHash } from "~/utils/api/types";
@zhoufenfens
zhoufenfens / charles.txt
Created October 14, 2019 08:33
charles
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 6, 2024 21:12
crack activate Office on mac with license file
@tomkis
tomkis / redux-saga-confirmation-dialog.js
Last active March 14, 2019 15:02
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'
@vasrap
vasrap / mercator-latlon-to-meters.rb
Last active March 15, 2021 15:54
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))