Skip to content

Instantly share code, notes, and snippets.

@remorses
remorses / script.py
Created March 4, 2024 11:17
Convert Openai ChatGPT exported data to csv
import csv
import json
def extract_messages(data, max_messages):
messages = []
for message_id, message_data in data["mapping"].items():
if message_data["message"]:
message = message_data["message"]
content = message.get("content", {}).get("parts", [""])[0]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ttesmer
ttesmer / AD.hs
Last active December 27, 2025 06:03
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active January 30, 2026 10:42
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active June 26, 2025 22:23
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@MarcSkovMadsen
MarcSkovMadsen / holoviz_linked_brushing.py
Last active October 23, 2024 09:30
Linked brushing with HoloViz
# pip install panel==0.12.4 bokeh==2.4.0 holoviews==1.14.6 hvplot==0.7.3 shapely==1.7.1
# panel serve holoviz_linked_brushing.py --autoreload --show
import hvplot.pandas
import holoviews as hv
import panel as pn
from bokeh.sampledata.iris import flowers
pn.extension(sizing_mode="stretch_width")
hv.extension("bokeh")
@sindresorhus
sindresorhus / esm-package.md
Last active February 7, 2026 23:53
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@azlen
azlen / bulletpaths.js
Last active September 11, 2025 03:00
All Paths Lead to Roam
/*
* credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield)
* for the original concept which was part of their RoamGames submission
* and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/
*
*/
/* ======= OPTIONS ======== */
/* note: if you change these, reload the page to see the effect */
@samuelhorn
samuelhorn / pacman-vscode
Created November 28, 2020 00:11
Vscode pacman caret
.monaco-editor .cursors-layer .cursor {
background: transparent;
border-radius: 100%;
width: 30px !important;
background: conic-gradient(yellow 55deg, transparent 0 125deg, yellow 0);
transform: rotateZ(180deg);
animation: eat 0.5s linear infinite;
}
@keyframes eat {
@dabit3
dabit3 / SingleTableAppSync.md
Last active January 24, 2026 12:01
GraphQL Single Table Design with DynamoDB and AWS AppSync

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}