Skip to content

Instantly share code, notes, and snippets.

View klequis's full-sized avatar

klequis klequis

View GitHub Profile
{-
Find matching dates in 2 timeseries and show difference in values
Uses `Int` as proxy for date.
Usage:
Load into GHCi and then
> printIt (findDiffs file2 file3)
(11,201.6), (11,201.6) | 0.0
(12,201.5), (12,199.5) | 2.0
(13,201.5), (13,197.5) | 4.0
(14,203.5), (14,197.5) | 6.0
@klequis
klequis / fibMem.js
Last active October 27, 2021 23:30
Calculate Fibbonacci numbers using Map() as memory cache
const fibTest = [
{
in: 0,
out: 0,
},
{
in: 1,
out: 1
},
{
@klequis
klequis / react-auth0-spa.js
Last active March 29, 2024 01:18
Modification to Auth0Provider in react-auth0-spa.js
import React, { useState, useEffect, useContext } from 'react'
import createAuth0Client from '@auth0/auth0-spa-js'
const DEFAULT_REDIRECT_CALLBACK = () =>
window.history.replaceState({}, document.title, window.location.pathname)
export const Auth0Context = React.createContext()
export const useAuth0 = () => useContext(Auth0Context)
let _initOptions