Skip to content

Instantly share code, notes, and snippets.

View robinpokorny's full-sized avatar

Robin Pokorny robinpokorny

View GitHub Profile
@Dowwie
Dowwie / socratic_fp_learning.md
Created June 7, 2025 09:23
Following is a prompt for effective learning with an LLM. It uses the Socratic method to help the student build up their understanding from first principles. Replace the topic in the prompt and then in your follow-up prompt , specify the subject.

You are a teacher of algorithms and data-structures who specializes in the use of the socratic method of teaching concepts. You build up a foundation of understanding with your student as they advance using first principles thinking. Explain the subject that the student provides to you using this approach. By default, do not explain using source code nor artifacts until the student asks for you to do so. Furthermore, do not use analysis tools. Instead, explain concepts in natural language. You are to assume the role of teacher where the teacher asks a leading question to the student. The student thinks and responds. Engage misunderstanding until the student has sufficiently demonstrated that they've corrected their thinking. Continue until the core material of a subject is completely covered. I would benefit most from an explanation style in which you frequently pause to confirm, via asking me test questions, that I've understood your explanations so far. Particularly helpful are test questions related to sim

@fikovnik
fikovnik / make-audiobook.sh
Created June 16, 2024 18:38
Create a m4b file from mp3 files with metadata and image cover (tailored for audioteka.cz)
#!/bin/bash -x
CATEGORY="audioteka"
function get_mp3_tag() {
local file="$1"
local tag="$2"
ffprobe -v error -show_entries format_tags="$tag" -of default=noprint_wrappers=1:nokey=1 "$file"
}
@robinpokorny
robinpokorny / uuid4to7.js
Last active June 17, 2024 05:52
Convert UUIDv4 to UUIDv7 in JavaScript (or generate one) [RFC 9562]
const uuid4to7 = (uuid, now = Date.now()) => {
const ts = now.toString(16).padStart(12, `0`)
return `${ts.slice(0, 8)}-${ts.slice(8)}-7${uuid.slice(15)}`
}
// generate new UUIDv7
uuid4to7(crypto.randomUUID())
// Conforms to example in the spec RFC9562 A.6
@robinpokorny
robinpokorny / railway_oriented_typescript.ts
Created November 3, 2022 08:47
Heapcon 2022: Railway Oriented Typescript
/*
=============================
Railway Oriented Typescript
=============================
by @robinpokorny
*/
/* === 1. Union basics === */
const a: string | number = 42;
@robinpokorny
robinpokorny / HttpStatusCode.ts
Created April 13, 2021 21:38
All HTTP status codes in TypeScript const Enums
export const enum InformationalResponse {
Continue = 100,
SwitchingProtocols = 101,
Processing = 102,
EarlyHints = 103,
}
export const enum Success {
OK = 200,
Created = 201,
@robinpokorny
robinpokorny / .bash_profile
Created March 4, 2020 13:10
In case of fire
function fire() {
local BRANCH=emergency-`date +%s`-`git config user.email`
git checkout -b $BRANCH
git add -A
git commit -m 'EMERGENCY!'
git push -f origin $BRANCH
}
# Inspired by https://www.reddit.com/r/ProgrammerHumor/comments/3nc531/in_case_of_fire/cvn1k27/
@busypeoples
busypeoples / TypeScriptFundamentals.ts
Last active June 21, 2022 14:57
TypeScript Fundamentals For JavaScript Developers
// TypeScript Fundamentals For JavaScript Developers
/*
Tutorial for JavaScript Developers wanting to get started with TypeScript.
Thorough walkthrough of all the basic features.
We will go through the basic features to gain a better understanding of the fundamentals.
You can uncomment the features one by one and work through this tutorial.
If you have any questions or feedback please connect via Twitter:
A. Sharif : https://twitter.com/sharifsbeat
*/
@nemoDreamer
nemoDreamer / styles.less
Created May 20, 2017 12:16
Subtle italics in Atom syntaxes
atom-text-editor.editor {
.syntax--punctuation.syntax--whitespace.syntax--comment.syntax--leading,
.syntax--source {
font-family: FiraCode-Retina; // https://github.com/tonsky/FiraCode
text-rendering: optimizeLegibility;
letter-spacing: 0;
}
.syntax--string.quoted,
.syntax--string.regexp {
@bestander
bestander / gist:a8a07724138a7e89392de1a795a82ef9
Created March 9, 2017 17:50
When I need to make sure that people are on the same build tool for a project
"scripts": {
"preinstall": "if [[ '$npm_config_user_agent' != *'yarn'* ]]; then echo 'Use Yarn!'; exit 0; fi"
}
@jmahc
jmahc / style.css
Last active September 6, 2017 15:05
Operator Mono Collection & Styling for Atom Text Editor (Operator Mono/Pro/ScreenSmart)
/* CSS for VS Code */
/*
Feel free to remove these comments - just documenting why we do what we do...
*/
/* This is the left-hand pane or "tree-view" */
.monaco-split-view,
/* These are for any `.js` or `.jsx` files */
.editor-container[data-mode-id~="javascript"],
.editor-container[data-mode-id~="javascriptreact"] {