Skip to content

Instantly share code, notes, and snippets.

View nealmcb's full-sized avatar

Neal McBurnett nealmcb

View GitHub Profile
@nealmcb
nealmcb / Byte-1978-07-neal-basic-insertion-sort.basic
Last active December 25, 2021 02:40
insertion sort in basic, by Neal McBurnett, July 1978 Byte magazine page 121
100 REM Insertion sort by Neal McBurnett for Byte magazine 1978-07
101 REM from page 121 of https://vintageapple.org/byte/pdf/197807_Byte_Magazine_Vol_03-07_Antique_Mechanical_Computers.pdf
120 print "How many numbers to be sorted?"
130 input n
140 print "Input numbers one at a time"
150 for i = 1 to n
155 dim a(n)
160 input a(i)
170 next i
@nealmcb
nealmcb / syzygy_astropy.py
Created November 23, 2021 02:49
find syzygy / equinox / solstice with astropy
# Find the nearest syzygy (solstice or equinox) to a given date.
# Solution for https://stackoverflow.com/questions/55838712/finding-equinox-and-solstice-times-with-astropy
# TODO: need to ensure we're using the right sun position functions for the syzygy definition....
import math
from astropy.time import Time, TimeDelta
import astropy.coordinates
from scipy.optimize import brentq
from astropy import units as u
@nealmcb
nealmcb / explore_noom_export.ipynb
Created July 3, 2021 16:11
Explore Noom data export
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nealmcb
nealmcb / README.rst
Last active March 18, 2021 14:32
test gist command

GIST

gist edit works!

'gist' is a command line interface for working with github gists. It provides several methods for inspecting a users gists, and the ability to easily create them.

@nealmcb
nealmcb / get_history.sh
Created October 12, 2020 12:17 — forked from TravelingTechGuy/get_history.sh
Get your Chrome history as a CSV file
#!/bin/bash
# Locate the history file in your profile, and copy it to the same folder as this script.
# On Mac: ~/Library/Application\ Support/Google/Chrome/Default/History
# On Windows: C:\Users\YOUR USER NAME\AppData\Local\Google\Chrome\User Data\Default\History
sqlite3 History <<!
.headers on
.mode csv
.output out.csv
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nealmcb
nealmcb / CivilTransparency.ipynb
Last active August 7, 2019 21:50
Civil Transparency Experiments in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nealmcb
nealmcb / gamma.ipynb
Last active August 22, 2018 17:03
Explanation of gamma in risk-limiting audits.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nealmcb
nealmcb / sampling_with_tickets.ipynb
Created June 19, 2018 06:05
Demo of Ron Rivest's Election Audit Sampling with Tickets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nealmcb
nealmcb / ecdsa_to_bitocin_addy.py
Last active October 22, 2024 05:09
Calculate Bitcoin address corresponding to given ECDSA private key. Handy for verifying document timestamps provided by OriginStamp.org.
#!/usr/bin/env python
"""Calculate Bitcoin address corresponding to given ECDSA private key.
Handy for verifying document timestamps provided by OriginStamp.org.
Usage: ecdsa_to_bitocin_addy.py ecdsa_private_key # that's a 64-character hex string
Prerequisite:
pip install ecdsa