Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / LLM.md
Last active May 7, 2024 13:50
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.

@dustingetz
dustingetz / crud.cljc
Last active February 20, 2022 02:06
100 LOC crud app
(ns user.blog-100-loc-crud-app
"Concrete minimum viable crud app that demonstrates strong composition and real world edge cases"
(:require
[clojure.spec.alpha :as s]
#?(:clj [datomic.api :as d])
[hyperfiddle.api :as hf]
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.html5 :as-alias html]))
@onlurking
onlurking / programming-as-theory-building.md
Last active April 19, 2024 22:31
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@Kameshwaran
Kameshwaran / heroku-database-url-to-config.sh
Created February 7, 2019 06:39
Shell script to extract details from DATABASE URL
# Sample DATABASE_URL = dbms://username:password@hostname:port/dbname
DB_PROTOCOL=$(echo $DATABASE_URL | cut -d':' -f1)
DB_DETAILS=$(echo $DATABASE_URL | cut -d'/' -f3)
DB_NAME=$(echo $DATABASE_URL | cut -d'/' -f4)
HOST_NAME=$(echo $DB_DETAILS | cut -d'@' -f2 | cut -d':' -f1)
PORT=$(echo $DB_DETAILS | cut -d'@' -f2 | cut -d':' -f2)
USER_NAME=$(echo $DB_DETAILS | cut -d'@' -f1 | cut -d':' -f1)
PASSWORD=$(echo $DB_DETAILS | cut -d'@' -f1 | cut -d':' -f2)
@dpaola2
dpaola2 / stripe_handler.js
Created September 30, 2018 23:23
Stripe Elements and Turbolinks
function doStripe() {
if (!document.getElementById('card-element')) {
return;
}
var stripe = Stripe(window.stripe_key);
var elements = stripe.elements();
var style = {};
var card = elements.create('card', {style: style});
@GeorgeLyon
GeorgeLyon / Rust vs. Swift.md
Last active April 4, 2024 21:16
A list of advantages Swift has over Rust

Note This is a little out of date. Rust has made some progress on some points, however many points still apply.

Philosophy

Progressive disclosure

Swift shares Rust's enthusiasm for zero-cost abstractions, but also emphasizes progressive disclosure. Progressive disclosure requires that language features should be added in a way that doesn't complicate the rest of the language. This means that Swift aims to be simple for simple tasks, and only as complex as needed for complex tasks.

The compiler works for you

@duncanjbrown
duncanjbrown / core.cljs
Created December 1, 2017 16:29
Basic circle packing with ClojureScript and d3.js
(ns bubble.core
(:require [d3 :as d3]))
(enable-console-print!)
(.format d3 "d") ; we will use integers for our data
; set up a color sequence. Later on we will pass numbers to the
; 'color' function defined here and it will give us back colours one
; by one.
defmodule Store do
@initializer_action %{type: "@@INIT"}
# Code your Mom calls
def start_link(reducer, initial_state \\ nil) do
GenServer.start_link(__MODULE__, [reducer, initial_state])
end
def get_state(store) do
@swillits
swillits / Keycodes.swift
Last active March 26, 2024 23:20
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35