forked from nat/natalieee.net
Compare commits
6 Commits
de34c5922c
...
compressio
Author | SHA1 | Date | |
---|---|---|---|
3244a017c6
|
|||
6b1c6de309
|
|||
978ae8fd03
|
|||
fe6f79d651
|
|||
0875e512a2
|
|||
6fcfa782b9 |
27
flake.lock
generated
27
flake.lock
generated
@ -1,27 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1747542820,
|
||||
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "292fa7d4f6519c074f0a50394dbbe69859bb6043",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
36
flake.nix
36
flake.nix
@ -1,36 +0,0 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in
|
||||
with pkgs;
|
||||
{
|
||||
devShells.x86_64-linux.default = mkShell {
|
||||
buildInputs = with python3Packages; [
|
||||
hy
|
||||
(buildPythonPackage rec {
|
||||
pname = "hyrule";
|
||||
version = "1.0.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-SZyFjXNs6thVWhKbajYelY0DoRYqrcCQcdKMNC5t6Og=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pip
|
||||
wheel
|
||||
hy
|
||||
];
|
||||
})
|
||||
bleach
|
||||
validators
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
hy>=1
|
||||
bleach>=6.2.0
|
||||
validators>=0.34.0
|
@ -1,26 +1,38 @@
|
||||
(import hyrule.collections [assoc])
|
||||
(import isal.igzip [compress :as gzip])
|
||||
(import isal.isal_zlib [compress :as zstd])
|
||||
|
||||
(defn send-code [code]
|
||||
(import hyrule.collections [assoc])
|
||||
(require hyrule.control [branch])
|
||||
|
||||
(defn pack-code [code]
|
||||
(.encode f"HTTP/1.1 {code}\r\n" "utf-8"))
|
||||
|
||||
(defn send-headers [headers]
|
||||
(defn pack-headers [headers]
|
||||
(.encode (+ (.join "\r\n" (lfor [k v] (.items headers) f"{k}: {v}")) "\r\n\r\n") "utf-8"))
|
||||
|
||||
(defn send-body [body]
|
||||
(cond
|
||||
(defn send [[code 200] [headers None] [body ""] [request-headers None]]
|
||||
(when (is headers None)
|
||||
(setv headers {}))
|
||||
|
||||
(setv body (cond
|
||||
(isinstance body bytes) body
|
||||
(isinstance body str) (.encode body "utf-8")))
|
||||
|
||||
(defn send [[code 200] [headers None] [body ""]]
|
||||
(when (is headers None)
|
||||
(setv headers {}))
|
||||
(when request-headers
|
||||
(when (.get request-headers "Accept-Encoding")
|
||||
(branch (in it (.get request-headers "Accept-Encoding"))
|
||||
"zstd" (do
|
||||
(setv (get headers "Accept-Encoding") "gzip")
|
||||
(setv body (zstd body)))
|
||||
"gzip" (do
|
||||
(setv (get headers "Accept-Encoding") "gzip")
|
||||
(setv body (gzip body))))))
|
||||
|
||||
(assoc headers "WHAT...-your-trans-gener..." "that is so cool...")
|
||||
|
||||
(when (not-in "Content-Type" headers)
|
||||
(assoc headers "Content-Type" "text/html"))
|
||||
|
||||
(+
|
||||
(send-code code)
|
||||
(send-headers headers)
|
||||
(send-body body)))
|
||||
(pack-code code)
|
||||
(pack-headers headers)
|
||||
body))
|
||||
|
@ -39,7 +39,7 @@
|
||||
True (get address 0))) f": {(. parsed-request (get "method"))} {(. parsed-request (get "route") (get "path"))}"))
|
||||
|
||||
(setv response (match-request parsed-request))
|
||||
(.sendall client-socket (http.response.send #** response))
|
||||
(.sendall client-socket (http.response.send :request-headers (.get parsed-request "headers") #** response))
|
||||
|
||||
(except [e Exception]
|
||||
(.warn log (format-exc))
|
||||
|
BIN
www/src/assets/88x31/it-its.png
Normal file
BIN
www/src/assets/88x31/it-its.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
www/src/assets/88x31/not-a-person.png
Normal file
BIN
www/src/assets/88x31/not-a-person.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 900 B |
BIN
www/src/assets/88x31/this-machine-kills-fascists.png
Normal file
BIN
www/src/assets/88x31/this-machine-kills-fascists.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -64,10 +64,24 @@ specific:
|
||||
src: //tasiaiso.vulpecula.zone/images/badges/tasiaiso.png
|
||||
alt: tasia's 88x31
|
||||
|
||||
# does not 301 to https if requested with http
|
||||
- host: //www.31a05b.net/
|
||||
src: https://www.31a05b.net/a/8831/31a05b.png
|
||||
alt: 31A05B9C's random site
|
||||
|
||||
- host: //bunbun.dev/
|
||||
src: //bunbun.dev/assets/88x31s/bunbun.dev.gif
|
||||
alt: bunbun.dev
|
||||
|
||||
general:
|
||||
- src: assets/88x31/e2vial-88x31.gif
|
||||
alt: an estrogen vial spinning next to the text "powered by estrogen"
|
||||
|
||||
- src: assets/88x31/it-its.png
|
||||
alt: it/its
|
||||
|
||||
- src: assets/88x31/not-a-person.png
|
||||
alt: not a person
|
||||
|
||||
- src: assets/88x31/this-machine-kills-fascists.png
|
||||
alt: this machine kills fascists
|
||||
|
@ -15,7 +15,7 @@
|
||||
(h2 "site info" ~(run "make-footnote \"as of last build\""))
|
||||
(details
|
||||
(summary "git changelog")
|
||||
(pre ~(run "git log --pretty=format:'%ad %s' --date=short")))
|
||||
(pre ~(run #[[git log --pretty=format:'%ad %s' --date=short | sed 's/</\</g; s/>/\>/g']])))
|
||||
|
||||
(details
|
||||
(summary "file tree of the site on the server")
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
timeout 0.6s nvim "$1" -c "set nonu | set nornu" -c "autocmd LspAttach * execute 'TOhtml | w! ${tmpfile} | qa!'" >/dev/null || nvim "$1" -c "set nonu | set nornu" -c "TOhtml | w! ${tmpfile} | qa!" >/dev/null
|
||||
timeout 0.6s nvim "$1" -c "set noswapfile" -c "%s/^$/ /g" -c "set conceallevel=0" -c "set nonu | set nornu" -c "autocmd LspAttach * execute 'TOhtml | w! ${tmpfile} | qa!'" >/dev/null || nvim "$1" -c "set noswapfile" -c "%s/^$/ /" -c "set conceallevel=0" -c "set nonu | set nornu" -c "TOhtml | w! ${tmpfile} | qa!" >/dev/null
|
||||
|
||||
cat "${tmpfile}" | pup --pre 'style, pre' | sed '/^$/d'
|
||||
|
||||
|
Reference in New Issue
Block a user