Skip to content

Instantly share code, notes, and snippets.

@sartak
sartak / socratic_fp_learning.md
Last active June 16, 2025 15:39 — forked from Dowwie/socratic_fp_learning.md
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 computer science 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 simple, explicit

@sartak
sartak / Dockerfile
Created January 17, 2024 22:57
Anki sync server Dockerfile
FROM debian:sid-slim
ENV THROW_AWAY=0005
ENV DEBIAN_FRONTEND=noninteractive
RUN set -ex && apt update --fix-missing && apt install -y curl build-essential protobuf-compiler && rm -rf /var/lib/apt/
RUN curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo install --git https://github.com/ankitects/anki.git --tag 23.12 anki-sync-server
use postgres::{Client, NoTls};
use rand::{
distributions::{Alphanumeric, DistString},
Rng,
};
use sea_query::*;
use sea_query_postgres::PostgresBinder;
use std::{hint::black_box, time::Instant};
#[derive(Iden)]
import { createContext, useContext, useEffect, useState } from "react";
import { type SpotlightActionData } from "@mantine/spotlight";
type ContextValue = Array<SpotlightActionData>;
type ContextType = [
ContextValue,
React.Dispatch<React.SetStateAction<ContextValue>>
];
const Context = createContext<ContextType>([[], () => {}]);
root@c546e96dead5:/app# bun --revision
1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a
root@c546e96dead5:/app# which node bun
/root/.bun/bin/bun
root@c546e96dead5:/app# gdb `which bun` frontend/core
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
// ==UserScript==
// @name Monkeytype results
// @version 0.1
// @description Monkeytype results
// @author You
// @match https://monkeytype.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@sartak
sartak / keymap.c
Last active December 26, 2022 18:44
Repeat Key
#include QMK_KEYBOARD_H
enum custom_keycodes {
REP = SAFE_RANGE
};
// use REP in the layout
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = ...
uint16_t key = 0;
@sartak
sartak / default-chords.csv
Last active October 11, 2022 17:27
Default CharaChorder1 chords for device shipped 2022-09-15
s + Dup say
y + b by
y + Dup why
n + Dup no
n + f find
l + f life
l + p people
l + s + p spell
l + n line
l + n + p plant
@sartak
sartak / gist:4a4a718c7d7ea05da7fd3551c975aa00
Created August 2, 2020 23:13
JavaScript for PC Anki (v2.1.19) and iOS AnkiMobile (2.0.63) to enable the card to automatically advance to the answer side
// Note: This assumes for iOS AnkiMobile that a midCenter tap advances to the answer side)
<script type="text/javascript">
$(document).ready(function () {
// see https://gist.github.com/sartak/581d3564dc42b689b604
if (window.anki && window.sendMessage) {
// delay to give Anki a chance to continue processing
setTimeout(function () {
window.sendMessage("ankitap", "midCenter");
}, 100);
[].__proto__.__proto__ = new Proxy({}, { get: (_, n) => n < 0 ? [] : [...[][n-1], n] })
// Proxy {}
[][5]
// (6) ["0", "1", "2", "3", "4", "5"]
[][42]
// (43) ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42"]