Skip to content

Instantly share code, notes, and snippets.

@veekaybee
veekaybee / normcore-llm.md
Last active May 2, 2024 13:01
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@jflam
jflam / app.py
Created January 16, 2023 02:55
Citations needed
# To run you'll need some secrets:
# 1. SERPAPI_API_KEY secret in env var - get from https://serpapi.com/
# 2. OPENAI_API_KEY secret in env var - get from https://openai.com
import streamlit as st
import json, os
from langchain.prompts import PromptTemplate
from langchain.llms import OpenAI
from serpapi import GoogleSearch
@molind
molind / parsel.sql
Created July 30, 2021 09:34
Parallel select and Parallel query
-- since it uses dblink it should be enabled in the database.
-- CREATE EXTENSION dblink;
-- And you'll may need to grant permissions to use it to your user.
-- GRANT EXECUTE ON FUNCTION dblink_connect_u(text) TO user;
-- GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO user;
-- Usage example:
-- select g_parsel('insert into osm_polygon_extra select osm_id, st_pointonsurface( st_collect( geom ) ) from osm_polygons group by osm_id;', 'osm_polygons', 12);
@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

@brito
brito / Catalog.js
Last active December 26, 2023 22:36
function __SMOKE_TEST__Catalog(){ console.log(
Catalog([{a:1, b:2}, {b:4, c:7, d:0}, {a:0, b:2}])
)}
/*
┌─┐┌─┐┌┬┐┌─┐┬ ┌─┐┌─┐
│ ├─┤ │ ├─┤│ │ ││ ┬
└─┘┴ ┴ ┴ ┴ ┴┴─┘└─┘└─┘ 18w40*/
function Catalog(items){
return ([].concat(arguments)).reduce(catalog, {});
@ddrscott
ddrscott / histogram.sql
Last active December 9, 2022 18:03
Histogram for PostgreSQL without width_bucket.
WITH params AS (
-- Parameters for down stream queries
SELECT
15 AS bucket_count,
80 AS max_bars
),
numbers AS (
-- Change this query to select real data.
-- For now we make random set of numbers.
SELECT
@brito
brito / example.html
Created April 26, 2017 21:48
Micro redirect (for saving link as local file)
<meta http-equiv=refresh content="0;URL=https://leanpub.com/javascriptallongesix/read">
@brito
brito / data.url.html
Created April 26, 2017 21:47
Data URL responsive iframe micro-snippet
data:text/html,<body style="padding-bottom:56.25%;background:#000;position:relative;height:0;overflow:hidden;margin:0"><iframe style="position:absolute;top:0;left:0;width:100%;height:100%;border:0" src="https://www.youtube.com/embed/CKvMmtclUBA" allowfullscreen></iframe>
@ppseprus
ppseprus / entropy-in-short.js
Last active February 27, 2022 14:19 — forked from jabney/entropy.js
Javascript implementation of a Shannon entropy calculation in bits per symbol
// Shannon entropy
const entropy = str => {
return [...new Set(str)]
.map(chr => {
return str.match(new RegExp(chr, 'g')).length;
})
.reduce((sum, frequency) => {
let p = frequency / str.length;
return sum + p * Math.log2(1 / p);
}, 0);
@brito
brito / city-of-la-wcp-template.jspx
Created September 22, 2015 19:30
Oracle WebCenter Portal Template Example
<?xml version='1.0' encoding='UTF-8'?>
<!--
City of Los Angeles Template
July 7, 2015
Oracle WebCenter Portal Template
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"