Skip to content

Instantly share code, notes, and snippets.

tonyfast / index.js
Created April 11, 2024 20:19
my first sonification
// Set up the Web Audio API context and create an oscillator node
audioCtx = new (window.AudioContext || window.webkitAudioContext)();
oscillator = audioCtx.createOscillator();
yourArray = [1,2,3,3,2,1]
// Calculate the range of pitches to use
minVal = Math.min(...yourArray);
maxVal = Math.max(...yourArray);
tonyfast / first_and_second_laws_of_thermodynamics.ipynb
Last active January 10, 2024 21:04
a notebook with revised literate pidgy cells for the first part of thermodyamics course
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class ACT(Exception): ...
class EN_301_549(Exception): ...
class EN_9_1_1_1(Exception): ...
class EN_9_1_2_2(Exception): ...
class EN_9_1_3_1(Exception): ...
class EN_9_1_4_1(Exception): ...
class EN_9_1_4_2(Exception): ...
class EN_9_1_4_3(Exception): ...
class EN_9_1_4_4(Exception): ...
class EN_9_2_1_1(Exception): ...
tonyfast / BinaryExamples.ipynb
Last active November 2, 2023 21:05
a revision of a pycalphad documentation page as literate program.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"name":"lorenz-executed","role":"document","actions":[],"value":"","nodeCssSelector":"","nodeType":9,"description":"","keyboardShortcut":"","childCount":3,"indexInParent":0,"states":["readonly","focusable","opaque","enabled","sensitive"],"children":[{"name":null,"role":"landmark","actions":[],"value":"","nodeCssSelector":".site","nodeType":1,"description":"","keyboardShortcut":"","childCount":2,"indexInParent":0,"states":["selectable text","opaque","enabled","sensitive"],"children":[{"name":" ","role":"text leaf","actions":[],"value":"","nodeCssSelector":".site#text","nodeType":3,"description":"","keyboardShortcut":"","childCount":0,"indexInParent":0,"states":["opaque","enabled","sensitive"],"children":[],"attributes":{"explicit-name":"true"}},{"name":"Skip to content","role":"link","actions":["Jump"],"value":"","nodeCssSelector":".visually-hidden","nodeType":1,"description":"","keyboardShortcut":"","childCo
tonyfast /
Last active February 21, 2023 22:35
extensible notebook schemas

an extensible schema for computational notebooks and cells

currently the notebook schema contains intrinsic notebook schema properties and application specific definitions. it would be good to separate the pure schema information from the application specific schema into something extensible. this document explores core set of definitions that can extended to either a traditional notebook container or a streaming lines format.

a notebook is a collection of cells that can be contained in different ways.

the defs schema is reused to demonstrate different top level schema. its purpose is to make cell schema and cell metadata schema extensible.

@(lambda x: x())
def df() -> "pandas.DataFrame":
with importnb.Notebook(): from __pyproject_analysis import tidy_configs, tidy_responses, gather, pyproject_query
return tidy_configs(df := tidy_responses(responses := gather(pyproject_query, max=15)))
tonyfast /
Created December 20, 2022 03:08
abc of python modules
import anyio as A
import bokeh as B, bs4 as B
import click as C
import doit as D
import emoji as E
import fastapi as F
import graphviz as G
import hvplot as H
import importnb as I
import jinja2 as J
from functools import singledispatch, singledispatchmethod
import types, gc, re, sys
from IPython.core.formatters import (
from traitlets import ObjectName, Unicode, Instance, List, Any
from IPython import get_ipython
tonyfast / hide_empty_outputs.html
Created December 17, 2022 23:08
a selection to hide empty jupyterlab output cells
.jp-OutputArea:not(:has(:not(:blank))) .jp-Collapser {
height: 0px;