Skip to content

Instantly share code, notes, and snippets.

@mhamilt
mhamilt / Thin-Plate-FDTD.ipynb
Created September 9, 2021 12:08
Example FDTD Plate scheme in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhamilt
mhamilt / DAFx20in21.ics
Last active September 8, 2021 08:47
DAFx20in21 ICS schedule
BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
PRODID:Ted
X-APPLE-CALENDAR-COLOR:#63DA38
X-WR-TIMEZONE:Europe/London
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
@mhamilt
mhamilt / BLE-UUIDs.m
Last active June 2, 2021 15:43
BLE Assigned Service and Characteristic UUIDs in an Objective-C NSDictionary
NSDictionary* bleUUIDs =
@{
@"service":
@{
@"1800": @"Generic Access",
@"1801": @"Generic Attribute",
@"1802": @"Immediate Alert",
@"1803": @"Link Loss",
@"1804": @"Tx Power",
@"1805": @"Current Time",
@mhamilt
mhamilt / interactive.ipynb
Last active May 21, 2021 09:30
Interactive IPYNB Widgets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhamilt
mhamilt / jupyter-acoustics.ipynb
Last active February 16, 2023 12:00
Jupyter Acoustics
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhamilt
mhamilt / make-icon-set.sh
Created March 16, 2021 12:08
Generate AppIcon Set with ImageMagick
filename=$(basename $1 .png)
for res in 1024 512 256 128 64 32 16
do
convert $1 -resize "${res}x${res}" "${filename}-${res}.png"
done
@mhamilt
mhamilt / harmonic-series.ipynb
Last active May 17, 2021 15:17
Does gist render Jupyter Notebooks?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhamilt
mhamilt / write_wave.py
Created March 2, 2021 12:27
Wave file with only Python standard libraries
import struct
import wave
import os
from math import sin, tau
sample_rate = 44100.0
duration = 2.0
frequency = 440.0
num_samples = int(sample_rate * duration)
bit_depth = 16
@mhamilt
mhamilt / wasapi-console.cpp
Last active September 11, 2025 07:51
WASAPI simple console application to play a sine wave
//-----------------------------------------------------------
// Play an audio stream on the default audio rendering
// device. The PlayAudioStream function allocates a shared
// buffer big enough to hold one second of PCM audio data.
// The function uses this buffer to stream data to the
// rendering device. The inner loop runs every 1/2 second.
//-----------------------------------------------------------
#include <iostream>
#include <windows.h>
@mhamilt
mhamilt / sh-exp-modes.md
Created November 17, 2020 11:50
Shell Expansion Modes

Modes

  • Parameter Expansion: ${}
  • Command Substitution: $()
  • Arithmetic Expansion: $(())

Examples

Parameter Expansion