Skip to content

Instantly share code, notes, and snippets.

View scruss's full-sized avatar
💭
🦆

Stewart Russell scruss

💭
🦆
View GitHub Profile
@gnomon-
gnomon- / get-seth-rogen-TTC-announcements.sh
Created August 1, 2018 03:55
Grab the Seth Rogen TTC etiquette announcement WAVs and convert them to appropriately tagged and named FLAC files
#!/bin/bash
# http://twitter.com/bradTTC/status/1024344192061853696
# blame gnomon
# prereqs: curl, awk, flac, metaflac, strings, grep
declare src='https://beta.ttc.ca/about-the-ttc/public-service-announcements'
declare alt='http://www.ttc.ca/sethrogen/index.jsp'
declare -i i=0 j=1
@rhydomako
rhydomako / 2017_04_18_sidewalk_inventory.ipynb
Last active July 22, 2017 00:23
Exploring the City of Toronto Sidewalk inventory using Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ednisley
ednisley / Cylindrical Cell Adapters.scad
Created April 15, 2017 23:55
OpenSCAD source code: Cylindrical cell adapters
// Cylindrical cell adapters
// Ed Nisley KE4ZNU April 2017
//- Extrusion parameters must match reality!
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
@kdzwinel
kdzwinel / jsk.c
Created January 19, 2017 00:38
JSK -JPEG Scan Killer
/*
* jsk.c
*
* Copyright (C) 2013, Frederic Kayser.
*
*/
#include <stdio.h>
#include <stddef.h>
@gbaman
gbaman / HowToOTGFast.md
Last active March 10, 2025 06:41
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@vielhuber
vielhuber / README.MD
Last active March 23, 2025 19:45
ffmpeg: Video convert m2ts to mp4, mp4 to webm, mp4 to ogv, mp3 wav hz, extract frames #tools

video convert m2ts to mp4, mp4 to webm, mp4 to ogv

mp4 to mp4 (medium)

ffmpeg -i input.mp4 -b 1000000 output.mp4

m2ts to mp4

ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4
@stonehippo
stonehippo / SimpleAudioFXTrigger.ino
Last active December 19, 2022 03:21
A simple Arduino trigger of the Adafruit Audio FX Sound Board
// A simple trigger for the Adafruit Audio FX Sound Board
// For complete info on the sound board, see https://learn.adafruit.com/adafruit-audio-fx-sound-board/overview
/*
This is a simple test of a direct trigger of the Audio FX Sounds Board from an Arduino.
For my test, I used an Arduino Pro Mini running at 3.3v & 8mHz. Digital pin #4 of the Arduino
was connected to trigger pin #0 of the Sound Board, and I tied them to a common ground. I powered
Sound Board via a USB external battery for the initial tests, and the Arduino via the FTDI cable.
For later tests, I powered the Sound Board via the Arduino's VCC (3v) pin directly.
@edwardhotchkiss
edwardhotchkiss / Makefile
Created March 5, 2014 23:30
ATtiny85 avr-gcc / avrdude Makefile
DEVICE = attiny85
CLOCK = 8000000
PROGRAMMER = stk500v1
PORT = /dev/tty.usbmodem1421
BAUD = 19200
FILENAME = main
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)
all: usb clean build upload
@paulkaplan
paulkaplan / colorTempToRGB.js
Last active January 30, 2025 14:32
Color Temperature to RGB
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;
@endolith
endolith / LICENSE.txt
Last active November 18, 2024 15:46
Arduino hardware true random number generator
MIT License
Copyright (c) 2012 endolith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: