Skip to content

Instantly share code, notes, and snippets.

// Utils
export interface TypedResponse<T extends Record<string, unknown> | unknown = Record<string, unknown>> extends Response {
json<P = T extends Record<string, unknown> ? T['application/json'] : unknown>(): Promise<P>
}
export const encodeURLQueryString = (params: Record<string, string | number | boolean>) =>
Object.keys(params)
.map((k) => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))
.join("&");
{ pkgs }:
let
inherit(pkgs) lib fetchurl;
inherit(pkgs.perlPackages) buildPerlPackage;
packages = rec {
AlgorithmCombinatorics = buildPerlPackage {
pname = "Algorithm-Combinatorics";
version = "0.27";
src = fetchurl {
type SampleRoutes =
| {
method: "GET";
path: `/path/${string}/members`;
data: string;
body: null
}
| {
method: "GET";
path: `/path/${string}/date`;
// deno-lint-ignore-file camelcase
import { writableStreamFromWriter } from "https://deno.land/[email protected]/streams/mod.ts";
const text = await Deno.readTextFile("./mods.txt");
const [query, ...urls] = text.split(/\n/).map((l) => l.trim()).filter((l) =>
l.length > 0 && !l.startsWith("#")
);
const [loader, version] = query.split(" ");
const HOST = "https://api.modrinth.com";
import tkinter as tk
from threading import Thread
import random
import time
# ablak létrehozása
window = tk.Tk()
window.geometry("450x450+500+250")
window.configure(bg="#fff")
frame = tk.Frame(window, bg="#000000")
(module
;; Import the required fd_write WASI function which will write the given io vectors to stdout
;; The function signature for fd_write is:
;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written
(import "wasi_unstable" "fd_write" (func $fd_write (param i32 i32 i32 i32) (result i32)))
(import "wasi_unstable" "fd_read" (func $fd_read (param i32 i32 i32 i32) (result i32)))
(memory 1)
(export "memory" (memory 0))
type Tuple<V, N extends number, T extends V[] = []> =
N extends T['length'] ? T : Tuple<V, N, [...T, V]>;
type Nat = Nat[]
type ToNumber<N extends Nat> = N['length']
type FromNumber<N extends number> = Tuple<Nat, N>
type Zero = []
type One = [Nat]
type N2 = Add<One, One>
@brecert
brecert / css.css
Last active February 9, 2022 07:53
.profile { color: rebeccapurple }
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>banner-grid</title>
<style>
:root {
--background: #22272e;
--background-rgb: 34 39 46;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.