Skip to content

Instantly share code, notes, and snippets.

View jonmitten's full-sized avatar

Jon Mitten jonmitten

View GitHub Profile
@jonmitten
jonmitten / sidlookup.json
Created March 1, 2019 19:53
JSON lookup for SIDs on a cellular network, lifted from https://www.roamingzone.com/system-id/sid1.shtml
[
{
"sid": "00001",
"market": "CHICAGO IL",
"band": "A",
"carrier": "AT&T"
},
{
"sid": "00002",
"market": "LOS ANGELES CA",
@jonmitten
jonmitten / sonic_py.md
Last active July 11, 2018 03:35
Getting RPi to play a wav file with Pygame and within a virtualenv

WARNING:: WORK IN PROGRESS

Overview

I had a few issues setting up my Raspberry Pi 3 b+ with Pygame, especially pygame.mixer, which doesn't just automatically install with pygame on a virtualenv. The virtualenv may be unnecessary, but to optimize portability between RPis, I wanted to have a requirements.txt to include with my favorite version of python this week, Python 3.6.

But, leave it to me to not document as I go - when I get in the zone, I have a hard time stopping to take notes between Google search, attempt fix, fail or succeed, and on to the next problem. So, I'm reserving this gist for doing it again. I'm planning on replicating this process for installation art, and before I'm able to construct a recipe for Ansible or RPi Baker, I will document the process here.

Installing Python 3.6

RPi ships (as of this writing) with Python 2.7 and Python 3.5 - and look, I love 3.5, but I was taught to always make a virtualenv whenever starting a new python project. So, it really doesn't matter what vers

@jonmitten
jonmitten / readme.md
Last active March 6, 2018 19:12
Javascript time conversion and maths

Overview

This Gist aims to serve as a reminder for myself and for anybody who finds this useful. Documenting the various ways of converting time in javascript, making time and date stamps, adding and subtracting time into human-readable formats, the goal is to have snippets and references that are outside of the Mozilla docs, largely drawn from StackOverflow. Links will be provided as available.

Assumptions

It is advisable to keep times in UTC timezone, adjusting to timezones only after all other conversions have taken place. This document assumes UTC as the timezone.

Timestamps

Get the current timestamp with Date.now():

var current_time = Date.now();
@jonmitten
jonmitten / keybase.md
Created October 27, 2017 01:41
keybase.md

Keybase proof

I hereby claim:

  • I am jonmitten on github.
  • I am smittles (https://keybase.io/smittles) on keybase.
  • I have a public key whose fingerprint is BF4B 3321 E9FC 4D2E 807E F625 E159 BAC0 E2A3 AA4E

To claim this, I am signing this object:

@jonmitten
jonmitten / Time Series Multi-Line.md
Last active September 10, 2018 10:58
Temperature Graph with threshold lines

A graph that interprets IoT temperature device through time, tracking internal to a refrigerator and external to a refrigerator.

Written in D3, and visible here

Gist available here