Skip to content

Instantly share code, notes, and snippets.

View mimoo's full-sized avatar
🦀
求同存异

David Wong mimoo

🦀
求同存异
View GitHub Profile
@mimoo
mimoo / json_serde.md
Created October 24, 2024 19:30
serializing json with non-string keys in a map
/*! `python` grammar compiled for Highlight.js 11.10.0 */
var hljsGrammar=(()=>{"use strict";return e=>{
const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],t={
$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,
built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super"
@mimoo
mimoo / tax_nyc.md
Last active September 12, 2024 21:15
paying tax in new york, the website doesn't work? try that

Paying taxes on https://www.tax.ny.gov/? You get some error message?

This is normal.

There website is shit.

You just need to clear your cookies, which you can by clicking on the button in the address bar.

@mimoo
mimoo / gist:57636f99f0cc507b3e84b1cc63b27344
Last active August 15, 2024 15:18
Beware about blossomup

I'm currently stuck trying to recover money from them. Do not pay for anything on blossomup.co as they will then continuously charge your accounts

@mimoo
mimoo / buy_mattresses.md
Created June 21, 2024 18:47
Mattresses are a huge scam

Beware when shopping for mattresses, store clerks will try to get you to commit by telling you false information. These 120-day return policies are a lie (unless it's Costco), of course they can deliver to your place in no time, there's no peak season, no. you don't sleep better in X and you don't need Y. They use all the sales tactic they can find (for example, if you're a couple they'll try to figure out who is the more opiniated of the two and side with them to force a buy).

In addition, all these brands are all owned by the same people. Tempur pedic, sealy, stearns, etc. There is no "luxury mattress". Past a certain price point (which I suspect is ~$500) it's all wasted money.

Don't trust the reviews! Nobody buys a mattress, sleep on it for a year or two, and then leaves a review on Reddit or on another website. It's all fake reviews. Any review that tells you X is bad, Y is much better, is basically fake. Don't trust what you read on reddit.

So what should you do? Costco or IKEA, that's it. Both have

@mimoo
mimoo / sage_5-2-1.sage
Created June 9, 2024 22:28
example 5.2.1 from Pairings for beginners
q = 5
Fq = GF(q)
R.<x> = Fq[]
Fq2.<i> = Fq.extension(x^2 + 2)
a = 0
b = -3
# Create elliptic curves over Fq and Fq2
E = EllipticCurve(Fq, [a, b])
E2 = EllipticCurve(Fq2, [a, b])
@mimoo
mimoo / smol.md
Last active November 16, 2023 13:51
Smol's introduction blogpost
@mimoo
mimoo / ocaml_parser.py
Created March 14, 2023 17:18
Parse crazy OCaml compiler errors
import sys
import os
import itertools
from rich.console import Console
from rich.syntax import Syntax
from rich.style import Style
from rich.progress_bar import ProgressBar
from rich.panel import Panel
from rich.console import Group
@mimoo
mimoo / hanoi.md
Created December 7, 2022 22:18
What to eat in Hanoi

Haven't been in a very long time, so I wouldn't be able to recommend specific places, but I can recommend specific dish.

image

Turmeric fish (Chả Cá Lã Vọng). This is a specialty and you can find places that only do that. There's a pan in front of you with some oil, and you put fish and dill and tumeric and cook it yourself.

image

DIY Fruit smoothies (Hoa Qua Dam). You can find that in the streets. They give you these cups with fruits and ice and condensed milk and you're supposed to blend everything yourself by hammering the content with your spoon. So good!

@mimoo
mimoo / dune
Last active November 18, 2022 21:41
An explainer on state monads in OCaml
(executable
(name state_monad)
(modules state_monad)
(libraries base stdio)
(preprocess
(pps ppx_let)))