This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demo using https://github.com/nicklockwood/Expression to parse | |
// https://www.wolframalpha.com/input/?i=Sawsbuck+Winter+Form%E2%80%90like+curve | |
import Foundation | |
import Expression | |
let Xt = "((-2/9 * sin(11/7 - 4 * t) + 78/11 * sin(t + 11/7) + 2/7 * sin(2 * t + 8/5) + 5/16 * sin(3 * t + 11/7) + 641/20) * θ(107 * π - t) * θ(t - 103 * π) + (-1/40 * sin(10/7 - 48 * t) - 1/20 * sin(32/21 - 47 * t) - 1/75 * sin(9/7 - 44 * t) - 1/10 * sin(35/23 - 41 * t) - 1/8 * sin(23/15 - 33 * t) - 1/13 * sin(38/25 - 30 * t) - 2/11 * sin(23/15 - 27 * t) - 1/7 * sin(14/9 - 23 * t) - 3/14 * sin(20/13 - 22 * t) - 1/5 * sin(17/11 - 19 * t) - 1/9 * sin(38/25 - 18 * t) - 1/13 * sin(14/9 - 13 * t) - 9/8 * sin(17/11 - 12 * t) - 3/10 * sin(11/7 - 11 * t) - 5/7 * sin(14/9 - 9 * t) - 6/7 * sin(17/11 - 6 * t) - 5/7 * sin(11/7 - 5 * t) - 131/15 * sin(11/7 - 3 * t) + 166/11 * sin(t + 11/7) + 82/13 * sin(2 * t + 11/7) + 5/4 * sin(4 * t + 11/7) + 7/15 * sin(7 * t + 33/7) + 23/22 * sin(8 * t + 11/7) + 7/5 * sin(10 * t + 19/12) + 1/2 * sin(14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import AVFoundation | |
import PlaygroundSupport | |
class Model: ObservableObject { | |
@Published var value: Double = 5.0 // sole source of truth | |
} | |
class ParamTree { | |
static let address: AUParameterAddress = 123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Snippets from my build.js script for my static site generator. Shows how I handle async render operations | |
// during the Remarkable render operation. | |
// | |
const md = new Remarkable("full", markdownOptions).use(katexPlugin).use(require("./consoleFence.js")); | |
// My own custom codeFence processing for static highlighting using Prism. | |
md.renderer.rules.fence = require("./codeFence.js"); | |
md.renderer.rules.fence_custom.graph = require("./graphFence.js"); | |
md.renderer.promises = {}; | |
md.renderer.addPromise = (key, promise) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to bump the build number and optionally the marketing version found | |
# in *.info files. | |
# | |
# Usage: bump-version.sh [ARG] | |
# | |
# Without ARG, just increment the build number. When ARG is present, it indicates | |
# which part of the marketing version to increment: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Custom mapping for Apple MacBookPro 2017 keyboard. | |
# | |
# - Map §/± (SECTION) to `/~ (BACKQUOTE) to match US keyboard | |
# - Map CAPS LOCK (LOCK) to SHIFT (L_SHIFT) to locking | |
# - Map right CMD (R_CMD) to CAPS LOCK to enable locking if really wanted | |
# - Map `/~ to (BACKQUOTE) to SHIFT (L_SHIFT) to make SHIFT-^ easier | |
# | |
# To run at startup: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plistlib, sys | |
from pprint import pprint | |
delimiter = '~' | |
def scan(srcRoot, playLimit): | |
albumMap = {} | |
for trackId, attributes in srcRoot['Tracks'].iteritems(): | |
albumName = attributes.get('Album') | |
artistName = attributes.get('Album Artist') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import websockets | |
import json | |
import pickle | |
import sys | |
import multiprocessing | |
import random | |
import time | |
from collections import deque |
NewerOlder