Skip to content

Instantly share code, notes, and snippets.

View sbma44's full-sized avatar

Tom Lee sbma44

View GitHub Profile
denon power toggle 2A4C028A0088:DENON:48
denon volume up 2A4C0280E86A:DENON:48
denon volume down 2A4C0288E862:DENON:48
denon roku select 2A4C0286B430:DENON:48
screen up http://192.168.1.4:8044/json?simple=1&pass=XHV2HFCTyi&plain=[{data:[1326,434,1276,430,1276,430,1274,432,504,1162,532,1162,534,1162,534,1166,534,1160,534,1160,1308,428,504,1160,534,1162,1308,428,506,1158,1310,430,1280,426,1280,426,506,1158,1310,426,1280,426,1280,426,506,1158,1310,430,1280,426,506,1158,1312,426,506,1160,1310,424,508,1158,536,1158,1310,29652,1312,424,1282,424,1282,424,1284,424,506,1160,536,1158,536,1158,536,1160,536,1160,534,1160,1314,424,508,1158,534,1160,1310,424,506,1160,1312,426,1282,422,1282,424,506,1160,1310,424,1282,424,1282,424,506,1158,1312,428,1282,424,506,1158,1312,424,508,1156,1312,424,508,1160,536,1156,1312],type:'raw',khz:38}]
screen down http://192.168.1.4:8044/json?simple=1&pass=XHV2HFCTyi&plain=[{data:[1292,442,1266,438,1268,440,1266,440,492,1204,490,1204,492,1204,490,1210,490,1206,1264,440,492,1206,490,1204,490
@sbma44
sbma44 / horror.py
Last active September 8, 2019 14:36
Lovecraft word pairs by rarity of vocab
# sample invocation:
# pdftotext -f 5 /tmp/The_Complete_Works_of_H.P._Lovecraft.pdf - | python3 horror.py | uniq > lovecraft_word_pairs_sorted.txt
import re
import sys
import nltk
import wordfreq
re_word = re.compile(r'[^\-\w]')
@sbma44
sbma44 / RegularHexagonalToroid24-solid.b.stl
Last active June 22, 2021 09:21
merge collinear segments in an SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

How OpenAddresses Organizes the World's Address Data

Location search relies upon address data, which links latitude and longitude coordinates like 38.8976,-77.0365 to human-readable addresses like 1600 Pennsylvania Avenue. This is an important but underappreciated type of geodata, and one that existing open data projects like OpenStreetMap have had limited success at collecting.

Many governments publish address data, but they do so in different ways. The data can be distributed as a Shapefile, CSV, KML, ZIP or GeoJSON file, or via an API. It can be presented in a variety of different geographic projections and character encodings. The names of fields are not standardized: for example, longitude might be stored in a field called LONG, X, LNG or LON. The license terms associated with the data can vary. Sometimes the data points to specific houses and sometimes it is no more specific than property parcels. The data might come with useful additional fields, like ZIP code or city name. The type of

@sbma44
sbma44 / bundle.js
Last active February 1, 2018 15:46
Verizon FiOS DC Rollout 2014-2016
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
mapboxgl.accessToken = 'pk.eyJ1Ijoic2JtYTQ0IiwiYSI6Inh1cm5teEEifQ.LFnEfmyK7mtxU5O64ID4ZA';
var fccData = require('./vzn_fios.json');
var active = 'December 2016';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/sbma44/cjd3amkei45zc2rp6oon0rk2t',
hash: true,
center: [ -77.029, 38.905 ],
zoom: 11.4
@sbma44
sbma44 / basic-query.sparql
Last active May 10, 2016 01:19
wikidata SPARQL queries, both for the USA (Q30)
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?flag ?seal ?coatofarms ?population ?website ?anthem ?article
WHERE {
OPTIONAL { ?location wdt:P1082 ?population . }
OPTIONAL { ?location wdt:P41 ?flag . }
OPTIONAL { ?location wdt:P94 ?coatofarms . }
OPTIONAL { ?location wdt:P158 ?seal . }
OPTIONAL { ?location wdt:P856 ?website }
OPTIONAL { ?location wdt:P85 ?anthem . }
kjnskdjnskfdjndksjnskdjnf
testing public gist
gistup