Skip to content

Instantly share code, notes, and snippets.

import qualified Data.Map.Strict as Map
memoizeRecursion :: Ord a => (a -> Maybe b) -> (a -> [a]) -> ([b] -> b) -> a -> b
memoizeRecursion base recur collect input =
snd $ cachedMemoizedRecursion base recur collect Map.empty input
callAndCache :: Ord a => (Map.Map a b -> a -> (Map.Map a b, b)) -> Map.Map a b -> [a] -> (Map.Map a b, [b])
callAndCache f cache =
foldr (\input (cache, results) ->
@felipekm
felipekm / pm2_rust.md
Last active May 25, 2023 16:12
Use PM2 with RUST

Make a Rust project: cargo init foo

Install PM2:

  1. npm init
  2. npm install pm2

Create a script entry in your package.json to launch pm2:

@deptno
deptno / fragment.ts
Created June 25, 2018 02:53
graphql-tag fragment example
import gql from 'graphql-tag'
const FRAGMENT_REPOSITORY = gql`
fragment repository on Repository {
name
url
createdAt
description
descriptionHTML
labels {
@ohshhh
ohshhh / spotify hosts
Created December 15, 2017 20:45
spotify hosts
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 adeventtracker.spotify.com
127.0.0.1 ads-fa.spotify.com
127.0.0.1 analytics.spotify.com
127.0.0.1 audio2.spotify.com
127.0.0.1 b.scorecardresearch.com
127.0.0.1 bounceexchange.com
127.0.0.1 bs.serving-sys.com
127.0.0.1 content.bitsontherun.com
@aelkz
aelkz / [FEDORA] gitkraken
Last active November 14, 2023 05:50
How to install gitkraken on Fedora [25,26,27] + launcher icon
#!/bin/bash
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# copy the downloaded file into /opt directory
cp gitkraken-amd64.tar.gz /opt/
cd /opt
@derdesign
derdesign / locales.json
Created June 16, 2012 18:54
locales.json
{
"af": "Afrikaans",
"sq": "Albanian",
"am": "Amharic",
"ar_DZ": "Arabic - Algeria",
"ar_BH": "Arabic - Bahrain",
"ar_EG": "Arabic - Egypt",
"ar_IQ": "Arabic - Iraq",
"ar_JO": "Arabic - Jordan",
"ar_KW": "Arabic - Kuwait",