$ pip install flask
$ pip install flask-login
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
use std::{marker::PhantomData, net::SocketAddr}; | |
use async_trait::async_trait; | |
use axum::{ | |
error_handling::HandleErrorLayer, | |
middleware::{self, Next}, | |
routing::get, | |
Router, | |
}; | |
use axum_core::{ |
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
echo -e $(curl -s https://api.openai.com/v1/completions \ | |
-H "Content-Type: application/json" \ | |
-H "Authorization: Bearer $OPENAI_API_KEY" \ | |
-d '{"model": "text-davinci-003", "prompt": "Extract tags from the following text. Limit five tags. Output JSON.\\n\\nText: Folksonomy is a classification system in which end users apply public tags to online items, typically to make those items easier for themselves or others to find later. Over time, this can give rise to a classification system based on those tags and how often they are applied or searched for, in contrast to a taxonomic classification designed by the owners of the content and specified when it is published.[1][2] This practice is also known as collaborative tagging,[3][4] social classification, social indexing, and social tagging.\\n\\n<Output>", "temperature": 0, "max_tokens": 1000}' | jq .choices[0].text) | tr -d '\\' | sed -r 's/^"|"$//g' | jq .tags |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.docker.system-prune</string> | |
<key>Program</key> | |
<string>/usr/local/bin/docker</string> | |
<key>ProgramArguments</key> | |
<array> |
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
set shell=/bin/bash | |
if &compatible | |
set nocompatible | |
endif | |
call plug#begin('~/.vim/plugged') | |
Plug 'airblade/vim-gitgutter' | |
Plug 'arcticicestudio/nord-vim' |
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
(ns merkle.tree | |
(:import [java.security MessageDigest])) | |
(defn sha-256-digest [bs] | |
(.digest | |
(doto (MessageDigest/getInstance "SHA-256") | |
(.update bs)))) | |
(def double-sha-256 (comp sha-256-digest sha-256-digest)) |
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
> "To be honest, this is a somewhat advanced usage of the transducers machinery," says the Grammarly Engineering Blog, right after shoehorning a BufferedReader into the mold with "reify IReduceInit". I already felt I'd got my money's worth from reading up to this half-way point. But I was astonished at what came next. | |
Though it pains me to speak of it, I tell you now I have seen this "blog post", and seen too what came next. Astonishing indeed! I admire your simple description of these events, as it suggests either a man of great fortitude in the face of horror, or a man who was able to flee and forget, and I know that I am neither. | |
I remember the reified specimen – still alive, god have mercy – placed upon an altar to be offered up to `eduction`. Yes! Placed squarely on its unsightly variadic first argument. Why? For what purpose? We are told: "it's a recipe for the values to come." The blood drained from my face. | |
It was soon apparent what eldritch function would feast upon the values begotten by t |
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
(def ^{:const true :private true} | |
base-62-alphabet | |
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") | |
(defn encode | |
"Encodes v in a new base of ks." | |
[ks v] | |
(let [base (count ks)] | |
(apply str | |
(reduce |
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
(defn half | |
[s] | |
(bit-shift-right (count s) 1)) ;; faster division by 2 | |
(defn left-right | |
[v] | |
(let [v (if-not (vector? v) (vec v) v) | |
h (half v)] | |
[(subvec v 0 h) (subvec v h)])) |
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
(defmacro loop-vars | |
"Like loop, but will automatically populate recur points where the special | |
var recur-> is found. | |
Mostly useful in mutable contexts, where some external factor causes the | |
recur bindings to change. | |
" | |
[bindings & body] | |
{:pre [(and (vector? bindings) | |
(even? (count bindings)))]} |
NewerOlder