Skip to content

Instantly share code, notes, and snippets.

View JnBrymn's full-sized avatar

John Berryman JnBrymn

View GitHub Profile
@JnBrymn
JnBrymn / run_single.py
Created September 18, 2026 22:57
Jev coin-bias calibration: one question per call (Choice-only + Noul-only sweeps, X=0..100 step 0.25, with charts)
#!/usr/bin/env python3
"""Coin-bias calibration, one question per call.
Same sweep as coin-calibration/run.py (X = 0..100 step 0.25) but each API
call carries exactly ONE question:
- choice-only call: "Which side will come up on the next flip?"
- noul-only call: "The next flip of this coin will come up heads."
Outputs:
responses_choice.jsonl one record per X (choice-only answers)
@JnBrymn
JnBrymn / code.py
Created February 9, 2024 15:23
This is CircuitPython for the CircuitPlaygroundExpress that allows you to record music by pushing the A button and then touching the capacitive sensors. And then you can play the song by pushing the B button.
print("STARTED")
import time
from adafruit_circuitplayground import cp
notes = {
"C": {
"frequency": 523.25,
"color": (0, 0, 3)
},
"D": {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
"""
This processes TiddlyWiki dumps to stick them into a format that Bear can import.
Full steps:
* First in your TiddlyWiki under the Tools menu click "export all>Static HTML".
* Next, run this command `process_tiddly_export --tiddler_dump_file=somewhere/tiddlers.html --output_directory=/tmp/some_empty_folder/ --extra_tags=any,tags,you,want` it will
* process the static HTML file into one file per tiddler
* each file will start with <h1>your tiddler title</h1>
* next it will list any #tags on the original tiddler as well as and extra tags you supplied
package main
import (
"fmt"
"math/rand"
"net/http"
"os"
"strconv"
"time"
)
/* MarkovModel creates a Markov model of text (or tokens) and allow you to generate new
* text from the model. It takes two optional arguments:
*
* tokenizer - a function that takes a string and returns an array of tokens
* defaults to a tokenizer that breaks on whitespace and lowercases everything
* shingle_n - the number of tokens that make up a state in the markov model
* the higher the number the more realistic the generated data, but the more
* training data required
* defaults to 1
* join_str - string used to join text together
package main
import (
"fmt"
"github.com/Shopify/sarama" //GIT hash = b3d9702dd2d2cfe6b85b9d11d6f25689e6ef24b0
"time"
)
var groupName = "trash"
var topicName = "event"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.