Skip to content

Instantly share code, notes, and snippets.

data Dial = Dial Int deriving (Show, Eq)
dialMod :: Num a => a
dialMod = 100
instance Num Dial where
(Dial x) + (Dial y) = Dial ((dialMod + x + y) `mod` dialMod)
negate (Dial x) = Dial ((dialMod - x) `mod` dialMod)
fromInteger x = Dial (fromInteger (x `mod` dialMod))
-- other Num methods skipped for brevity
package org.example;
import static java.lang.reflect.AccessFlag.PUBLIC;
import static java.lang.reflect.AccessFlag.STATIC;
import static java.util.Objects.requireNonNull;
import static java.util.function.Function.identity;
import static org.example.TyEq.refl;
import static org.example.TypeClass.Witness.Overlap.OVERLAPPABLE;
import static org.example.TypeClass.Witness.Overlap.OVERLAPPING;
import static org.example.TypeClasses.witness;
package org.example;
import static java.lang.reflect.AccessFlag.PUBLIC;
import static java.lang.reflect.AccessFlag.STATIC;
import static java.util.Objects.requireNonNull;
import static org.example.TypeClassSystem.witness;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Method;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Screen Capture</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
const libc = Deno.dlopen(
"libc.so.6",
{
dup2: {
parameters: ["i32", "i32"],
result: "i32",
},
errno: {
type: "i32",
},
@Garciat
Garciat / vscode-tunnel.tsx
Last active February 22, 2025 07:33
Manage your VS Code Remote Tunnel with Deno + CGI.
#!/usr/bin/env -S /home/garciat/homebrew/bin/deno --allow-env --allow-run --allow-read --allow-write --allow-net
import "jsr:@std/dotenv/load";
import { readAllSync } from "jsr:@std/io/read-all";
import { writeAllSync } from "jsr:@std/io/write-all";
import { deleteCookie, getCookies, setCookie } from "jsr:@std/http/cookie";
import { Application, Context, Router } from "jsr:@oak/oak";
@Garciat
Garciat / vscode-tunnel.py
Last active February 22, 2025 08:07
Manage your VS Code Remote Tunnel with Python 3 + CGI.
# pip install google-api-python-client python-dotenv
from typing import Optional, List, Tuple, Dict
from dataclasses import dataclass
import http.cookies
import os
import subprocess
import sys
import urllib.parse