Skip to content

Instantly share code, notes, and snippets.

View berstend's full-sized avatar
🐋
⊂(◉‿◉)つ b̡͉̙̞͙͔͔̺̉͌̽̽͂̿͂͝erstend͔͝

berstend̡̲̫̹̠̖͚͓̔̄̓̐̄͛̀͘ berstend

🐋
⊂(◉‿◉)つ b̡͉̙̞͙͔͔̺̉͌̽̽͂̿͂͝erstend͔͝
  • Berlin, Germany
View GitHub Profile
@adamsmith
adamsmith / gist:2a22b08d3d4a11fb9fe06531aea4d67c
Created December 23, 2023 01:07
voice-memo transcript → organized markdown text, using LLMs
There are two prompts, that chain together. The first prompt does most of the work, and the second prompt organizes the sections. I found because of the nature of how LLMs write, I couldn't get just one prompt to never jump back and forth in topics.
Prompt 1, which takes as input a raw transcript and generates a structured-text version...
"""# Instructions
A transcript is provided below of a voice memo I recorded as a "note to self". please extract all the points made or thoughts described, and put them in bullet-point form. use nested bullet points to indicate structure, e.g. a top-level bullet for each topic area and sub-bullets underneath. use multi-level nesting as appropriate to organize the thinking logically. use markdown formatting with `*` instead of `-` for bullet points.
DO NOT OMIT ANY POINTS MADE. This is not a summarization task — your only goal is to structure the thoughts there so they are logically organized and easy to read. Be concise because the reader is busy, but again DO NOT omit any

2023-08-22T20:18:12 conversation: 01h8fec5xgr78z9pyfmdgnwy33

Model: mlc-chat-Llama-2-13b-chat-hf-q4f16_1

Prompt:

Five cute names for a pet weasel

Response:

@berstend
berstend / es6_delay.md
Last active July 16, 2023 14:26
The best ES6 Promise.delay functions

Hello future self, here's the TypeScript version for your copy/pasting pleasure:

const delay = (ms: number) => new Promise(_ => setTimeout(_, ms))

and your favorite JS version:

const delay = ms => new Promise(_ => setTimeout(_, ms))
@pandrewhk
pandrewhk / FreeBSD 13.2 arm64 on Hetzner CAX11 Installation
Last active September 26, 2023 17:46
FreeBSD 13.2 arm64 on Hetzner CAX11
- # download VIMAGE to a spare FreeBSD box
- unxz -T0 # uncompress
- mdconfig image.raw; mount # for editing
- sshd_enable
- devmatch_blacklist="virtio_random.ko" # avoid a bug
- PermitRootLogin
- /root/.ssh/authorized_keys
- umount; mdconfig -d
- xz -T0 -9 # compress edited image
- cp nginx/ # publish with any web server
@gnat
gnat / postgres_portable_no_install.md
Last active July 22, 2024 09:47
Postgres Standalone

🐘 Postgres Standalone

Why?

  • Localize your database into one single folder of your choosing.
  • No sudo / root requirement.
  • Run multiple Postgres at the same time on the same machine- Full bare metal performance.
  • Postgres is a great starter before moving to "slow single machine but horizontal scale": CockroachDB, ScyllaDB, etc.

Compile

@mhasbini
mhasbini / webmssdk.js
Created December 24, 2022 11:13
Deobfuscated version of https://sf16-website-login.neutral.ttwstatic .com/obj/tiktok_web_login_static/webmssdk/1.0.0.1/webmssdk.js
!(function (arg1, arg2) {
if ("object" == typeof exports && "undefined" != typeof module) {
arg2(exports);
} else if ("function" == typeof define && define.amd) {
define(["exports"], arg2);
} else {
arg2(
((arg1 = "undefined" != typeof globalThis ? globalThis : arg1 || self).byted_acrawler =
{})
);
@revivalizer
revivalizer / gist:935dfcc345b009a0207a033caee0175f
Created August 18, 2022 10:55
Recursive descent calculator example
// Had to cut some stuff out that distracted from the main point, so maybe it doesn't compile, but...
struct calculator {
bool Succes;
const char* Start;
const char* FailAt;
const char* Error;
const char* C;
real Compute(const char* ExprStr) {
Succes = true;
@raphlinus
raphlinus / not_too_clever.md
Created June 23, 2022 00:50
Translation of grugbrain.dev into English

The not-too-clever programmer

This is a translation of grugbrain.dev into clear English. All props to the original author.

Introduction

This is a collection of thoughts on software development, originally written by an pseudonymous author styling themselves the "grug brain developer," but then translated into clear English by Raph Levien.

I am not an extremely smart developer, but I have many years of experience and have learned some things, although still don't know everything.

crasher = someBool => {
let divZero = Math.min(Infinity ? [] : Infinity, -0) / 0;
if (someBool) divZero = -0;
return divZero ? 1 : 0
};
crasher(false);
for (let i = 0; i < 0x10000; ++i) crasher(false);

As we were preparing Playwright 1.1.0, I learned quite a lot about Web Proxies. Below is the summary of my findings.

TIL: WEB Proxies

Reverse Web Proxy vs Forwarding Web Proxy

There are two groups of proxies that drive internet: