Skip to content

Instantly share code, notes, and snippets.

@joebowbeer
joebowbeer / duckpgq-kuzudb-study.sql
Last active February 4, 2025 09:29
Queries from KùzuDB's Benchmark study ported to DuckPGQ
-- Adapted from https://github.com/prrao87/kuzudb-study
-- Load vertices and edges
CREATE TABLE City AS SELECT * FROM
'https://github.com/prrao87/kuzudb-study/raw/main/data/output/nodes/cities.parquet';
CREATE TABLE Country AS SELECT * FROM
'https://github.com/prrao87/kuzudb-study/raw/main/data/output/nodes/countries.parquet';
CREATE TABLE Interest AS SELECT * FROM
'https://github.com/prrao87/kuzudb-study/raw/main/data/output/nodes/interests.parquet';
@joebowbeer
joebowbeer / duckpgq-demo.sql
Last active February 1, 2025 13:33
Kuzu's "Getting Started" ported to DuckPGQ
-- Adapted from https://docs.kuzudb.com/get-started/
-- Install and load SQL/PGQ extension
INSTALL duckpgq FROM community;
LOAD duckpgq;
-- City vertex table
CREATE TABLE City AS SELECT * FROM read_csv(
'https://github.com/kuzudb/kuzu/raw/master/dataset/demo-db/csv/city.csv',
names=[name, population]
@joebowbeer
joebowbeer / duckpgq-twitch-gamers.sql
Last active February 1, 2025 14:26
Twitch Gamers data in DuckDB with SQL/PGQ extensions
-- From https://motherduck.com/blog/duckdb-puppygraph-graph-model-on-motherduck/
install zipfs from community;
load zipfs;
load httpfs; -- TODO: autoload
CREATE TABLE account AS SELECT * FROM read_csv(
'zip://https://snap.stanford.edu/data/twitch_gamers.zip/large_twitch_features.csv',
types={mature: boolean, dead_account: boolean, affiliate: boolean}
);
@joebowbeer
joebowbeer / puck-js-midi-receiver.js
Created April 29, 2023 03:47
Receive BLE MIDI events on Puck.js and other Espruino devices
/// Receives MIDI events
function recv(evt) {
var data = evt.data;
var cmd = data[2] & 0xF0; // command
var chn = data[2] & 0x0F; // channel
var num = data[3]; // note or controller number
var val = data[4]; // velocity or controller value
switch(cmd) {
case 0x80: // noteOff
case 0x90: // noteOn
@joebowbeer
joebowbeer / importing.module.ts
Created February 8, 2022 01:22 — forked from evolkmann/importing.module.ts
Create Nest.js modules with custom config
import { Module } from '@nestjs/common';
import { MyLibModule } from './my-lib.module';
@Module({
imports: [
MyLibModule.register({ name: 'Enzo' }),
]
})
export class ImportingModule {}