Skip to content

Instantly share code, notes, and snippets.

@lanmower
lanmower / rules
Last active February 23, 2025 17:13
Iterate by fixing underlying problems in the codebase until all tests work.
Implement motion capture using MediaPipe.
Utilize a Web Worker with SharedArrayBuffers for performance.
Focus on:
- Starting the camera
- Running motion capture for a few seconds
- Stopping to check for detected motion
Execute commands in the foreground.
@lanmower
lanmower / gist:77234786dacf18b7021cc85141006d9d
Created January 31, 2025 10:53
Bookmarklet - page to prompt
javascript:(function() { const pageTitle = document.title; const pageContent = document.body.innerText; const prompt = `###%20Title:%20${pageTitle}\n\n###%20Content:\n${pageContent}%60;%20const%20textarea%20=%20document.createElement('textarea');%20textarea.value%20=%20prompt;%20document.body.appendChild(textarea);%20textarea.select();%20let%20successful;%20try%20{%20successful%20=%20document.execCommand('copy');%20}%20catch%20(err)%20{%20console.error('Could%20not%20copy%20text:%20',%20err);%20successful%20=%20false;%20}%20document.body.removeChild(textarea);%20if%20(successful)%20{%20alert('Page%20content%20copied%20as%20LLM-readable%20prompt!');%20}%20else%20{%20alert('Failed%20to%20copy%20the%20content.%20Please%20try%20again.');%20}%20})();
{
"schema": [
{
"mode": "server",
"proto": "udp",
"port": "27005",
"host": "127.0.0.1",
"secret": "123"
},
{
# -*- coding: utf-8 -*-
__all__ = [
"zynthian_ctrldev_akai_apc_key25_mk2",
"zynthian_ctrldev_akai_apc_key25",
"zynthian_ctrldev_akai_midimix",
"zynthian_ctrldev_akai_mpk_mini_mk3",
"zynthian_ctrldev_duopiano",
"zynthian_ctrldev_korg_nanokontrol2",
"zynthian_ctrldev_launchkey_mini_mk3",
"zynthian_ctrldev_launchpad_mini",
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import signal
import jack
from bisect import bisect
from copy import deepcopy
from functools import partial
import multiprocessing as mp
import React, { useRef, useEffect } from 'react'
import { useWorld, useSyncState, randomInt } from 'hyperfy'
export const blenderVec3 = ([x, y, z]) => [x, z, -y]
const headOffset = [
[0,0,0],[0,0,0],[0,0,0]
]
export default function Heads() {
var udp = require('dgram');
const yargs = require('yargs');
const pump = require('pump');
const argv = yargs
.option('mode', {
alias: 'm',
describe: 'client or server'
}).option('host', {
alias: 'h'
}).option('port', {
# INSTALL DOCKER
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
@lanmower
lanmower / signer
Last active January 14, 2022 13:55
<script src="https://unpkg.com/[email protected]/dist/index.js"></script>
<script src="https://unpkg.com/[email protected]/nacl.min.js"></script>
<script src="https://bundle.run/[email protected]"></script>
// SIGNER
window.packr = new msgpackr.Packr({ structuredClone: true });
const C = {
CONTRACT: 'c',
ACTION: 'a',
@lanmower
lanmower / README.txt
Created December 18, 2021 13:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS