Skip to content

Instantly share code, notes, and snippets.

View zhouzi's full-sized avatar

Gabin Aureche zhouzi

View GitHub Profile
import { useCallback, useRef } from "react";
export function useLatestCallback<T extends (...args: any[]) => any>(callback: T): T {
const ref = useRef(callback);
ref.current = callback;
return useCallback((...args: Parameters<T>) => ref.current(...args), []) as T;
};

Comparaison de l'offre mobile à la Réunion

Pour l'ensemble des offres séléctionnées ci-dessous, les appels, SMS et MMS sont illimités. Seules les offres internet 4G sont prises en considération, les offres 5G étant significativement plus chers (ou inexistantes).

Opérateur Internet mobile Roaming Tarif mensuel
RED by SFR 120go 50go 9.99€
Free 120go 25go 9.99€
Sosh 150go 150go[^2] 12.99€[^3]
Zeop Illimité Illimité 19.99€[^4]
(async () => {
const response = await fetch('<url>', {
method: 'get',
headers: {
'Authorization': 'Bearer <token>'
}
});
const blob = await response.blob();
const url = URL.createObjectURL(blob);
@zhouzi
zhouzi / raven-config.html
Last active May 22, 2018 09:12 — forked from impressiver/raven-config.html
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',