Skip to content

Instantly share code, notes, and snippets.

View Umbrien's full-sized avatar
🇺🇦
What's happening?

Umbrien Umbrien

🇺🇦
What's happening?
View GitHub Profile
@s-macke
s-macke / gpt-4-tokens.txt
Last active February 23, 2024 17:58
All 100k GPT-4 Tokens. New lines are replaced with \n and carriage returns with \r. The index of the token is (index=line-1). The list is extracted using https://github.com/openai/tiktoken
!
"
#
$
%
&
'
(
)
*
@epicbytes
epicbytes / example.api.ts
Last active February 6, 2024 18:28
NextJS Authorization Files
/*** function that used as middleware ***/
accessToken: async (name) => {
if (typeof document === "undefined") return "";
let token = document.cookie
.split(";")
.filter((cookie) => cookie.startsWith("token"))[0];
if (!token) {
const response = await fetch("/api/refresh", { method: "POST" });
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active April 4, 2024 10:29 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@cqfd
cqfd / the_ascii_monad.txt
Created July 28, 2011 01:12
Monads, explained with Ascii art.
Monads are composed of three ingredients.
First, for a given monad m, there are monadic values of type m a, for some type
variable a. In Haskell, if a variable x has type t, we write x :: t.
Here's a picture of a monadic value of type m a.
+--------\
| | \
| m | a > :: m a