This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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("&"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs }: | |
let | |
inherit(pkgs) lib fetchurl; | |
inherit(pkgs.perlPackages) buildPerlPackage; | |
packages = rec { | |
AlgorithmCombinatorics = buildPerlPackage { | |
pname = "Algorithm-Combinatorics"; | |
version = "0.27"; | |
src = fetchurl { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SampleRoutes = | |
| { | |
method: "GET"; | |
path: `/path/${string}/members`; | |
data: string; | |
body: null | |
} | |
| { | |
method: "GET"; | |
path: `/path/${string}/date`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.profile { color: rebeccapurple } |