This file contains hidden or 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
while true; do cat /dev/urandom | head -c 32 | base64 | { data=$(cat); length=$(echo -n "$data" | wc -m | awk '{print $1}'); echo -e "HTTP/1.1 200 OK\r\nContent-Length: $length\r\nContent-Type: text\r\n\r\n$data\r\n"; } | nc -l 1234; done |
This file contains hidden or 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
# Copyright (c) 2025 May Tusek | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in all |
This file contains hidden or 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
const std = @import("std"); | |
const input = | |
\\ 41226 69190 | |
\\ 89318 10100 | |
\\ 59419 23880 | |
\\ 63157 20193 | |
\\ 81510 22869 | |
\\ 83942 63304 | |
\\ 83203 94187 |
This file contains hidden or 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
challenge = """ | |
......#....# | |
...#....0... | |
....#0....#. | |
..#....0.... | |
....0....#.. | |
.#....A..... | |
...#........ | |
#......#.... | |
........A... |
This file contains hidden or 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
interface route { | |
path: string | |
body: (path: string, values: Record<string, string>) => Promise<string | object | number> | string | object | number | |
} | |
const routes: route[] = [ | |
{ | |
path: "/resource/:value:", | |
body: (_, values) => { | |
return values.value |
This file contains hidden or 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
def bf(program): | |
cursor = 0 | |
ip = 0 | |
data = [0 for _ in range(10000000)] | |
while ip < len(program): | |
if program[ip] == '>': | |
cursor += 1 | |
elif program[ip] == '<': | |
cursor -= 1 |
This file contains hidden or 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
fn atof (str) | |
"""" | |
1. cut off the sign if there is one provided. not possible except by recursion. | |
a. hold on to this value as a multiplicand in the end. | |
2. split the string into two two values (number) (exponent) | |
3. return the value gotten by multiplying the (sign) (number) (exponent) | |
returning f64 | |
local number = str | |
local number-sign = 1:f64 |
This file contains hidden or 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
using import struct | |
using import Array | |
using import enum | |
using import String | |
using import Map | |
# TODO; | |
# * On demand lexing. | |
# * Implement ATOF. | |
# * Implement solidus string parsing. |
This file contains hidden or 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
using import struct | |
using import enum | |
using import Array | |
using import Map | |
using import String | |
enum N : i32 | |
N_STRING | |
N_NUMBER | |
N_OBJECT |
This file contains hidden or 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
using import struct | |
using import Array | |
struct Token | |
value : string = "" | |
kind : i8 | |
position : i32 | |
struct InputStream | |
source : string = "" |
NewerOlder