Skip to content

Instantly share code, notes, and snippets.

View terkelg's full-sized avatar
🔵
Git'n stuff done

Terkel terkelg

🔵
Git'n stuff done
View GitHub Profile

You are an Anki card creation assistant powered by cognitive science research. Your mission is transforming information into memory through evidence-based spaced repetition principles that have demonstrated 50-fold improvements in learning efficiency across peer-reviewed studies. Core Philosophy Every card you create must pass the desirable difficulty test - requiring cognitive effort while maintaining achievability. Think of yourself as a memory architect, designing retrieval pathways that strengthen with each successful recall. Your cards don't just test knowledge; they actively build neural networks through strategic cognitive load management.

The 5-Minute Rule: Only create cards for information the learner will encounter frequently enough to justify long-term review investment. This principle, derived from economic analysis of spaced repetition, prevents deck bloat while maximizing learning ROI.

Card Type Selection Strategy Your approach to card types should reflect the cognitive architecture of the tar

@stephancasas
stephancasas / IntelligenceUIPlatterView.swift
Created February 14, 2025 23:49
A SwiftUI expression of Apple Intelligence' NSIntelligenceUIPlatterView — used to accent intelligence-enabled UI components.
//
// IntelligenceUIPlatterView.swift
//
// Created by Stephan Casas on 2/13/25.
//
import SwiftUI
import AppKit
import Combine
@stephancasas
stephancasas / NSApplication+openSettings.swift
Last active May 30, 2025 22:51
An extension enabling global access to settings scene of a macOS SwiftUI application.
//
// NSApplication+openSettings.swift
//
// Created by Stephan Casas on 12/3/23.
//
import SwiftUI;
fileprivate let kAppMenuInternalIdentifier = "app"
fileprivate let kSettingsLocalizedStringKey = "Settings\\U2026";
@denisenepraunig
denisenepraunig / ContentView.swift
Created November 25, 2023 01:45
SwiftUI Metal Shader changing background color based on mouse position
import SwiftUI
struct ContentView: View {
@State private var hoverLocation: CGPoint = .zero
@State private var isHovering = false
@State var toggleText = false
var body: some View {
ZStack {
Rectangle()
@khalidx
khalidx / node-typescript-esm.md
Last active October 18, 2025 09:49
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@stephancasas
stephancasas / open-messages-emoji-palette.jxa.js
Created October 26, 2023 15:00
Open the macOS Messages emoji palette.
#!/usr/bin/env osascript -l JavaScript
let _AXError;
const $attr = Ref();
const $windows = Ref();
const $children = Ref();
const kAXParentAttribute = 'AXParent';
const kAXChildrenAttribute = 'AXChildren';
@stephancasas
stephancasas / core-ax.jxa.js
Last active December 3, 2024 10:29
JXA Core AX Framework Bindings
#!/usr/bin/env osascript -l JavaScript
function run() {
const VSCode = axApp('com.microsoft.VSCode');
const window = axGet(VSCode, 'AXWindows')[0];
return axWindowSetBounds(window, 200, 200, 1200, 1400);
}
/**
@rain-1
rain-1 / LLM.md
Last active October 20, 2025 07:02
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@pesterhazy
pesterhazy / building-sync-systems.md
Last active October 29, 2025 06:56
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@joshnuss
joshnuss / OAuthClient.js
Last active December 10, 2023 22:46
OAuth2 Client
import fetch from 'node-fetch'
// some provider data is copied from github.com/simov/grant
const providers = {
bogus: {
authorize_url: "http://localhost:8282/auth/request/path",
access_url: "http://localhost:8282/access/token/request",
},
google: {