Skip to content

Instantly share code, notes, and snippets.

View brito's full-sized avatar
πŸ€”

brito brito

πŸ€”
View GitHub Profile
@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 / 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, {});
@onlurking
onlurking / programming-as-theory-building.md
Last active May 6, 2025 06:16
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

@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);
@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
@veekaybee
veekaybee / normcore-llm.md
Last active May 6, 2025 20:15
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