Skip to content

Instantly share code, notes, and snippets.

@mpmckenna8
mpmckenna8 / index.html
Last active February 12, 2019 15:27
mapbox-gl.js drag a point and have a line that connects it to another point move
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Create a draggable point</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@mpmckenna8
mpmckenna8 / .block
Created December 28, 2017 16:39
berlin52 plot
license: mit
@mpmckenna8
mpmckenna8 / bbcradio.sh
Created July 21, 2017 19:47 — forked from noodlebug/bbcradio.sh
Play BBC Radio with mpd or mplayer from the command line
#!/bin/bash
play() {
playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/low/ak/bbc_$1.m3u8"
echo $playlist
if mpc
then
mpc add $playlist
mpc play
else
mplayer $playlist
@mpmckenna8
mpmckenna8 / bbcradio.sh
Created July 21, 2017 19:47 — forked from stengland/bbcradio.sh
Play BBC Radio with mpd or mplayer from the command line
#!/bin/bash
play() {
playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_$1.m3u8"
echo $playlist
if mpc
then
mpc add $playlist
mpc play
else
mplayer $playlist
@mpmckenna8
mpmckenna8 / .block
Created July 21, 2017 16:46 — forked from baramuyu/.block
D3.js v4 Gantt Chart, example 3
license: mit
@mpmckenna8
mpmckenna8 / samplebooks.json
Created June 29, 2017 04:26
noisebridge library sample json
[{"isbn": "9781578701902", "openlibrary_preview_url": "", "title": "GNU Autoconf, Automake, and Libtool", "lccn": "99067439", "number_of_pages": "390", "openlibrary_medcover_url": "", "subjects": "", "publish_date": "2001", "dewey_decimal_class": "", "authors": "", "id": 1236, "olid": "OL18155654M", "location": null}, {"isbn": "9781590595589", "openlibrary_preview_url": "https://archive.org/details/foundationflasha00legg", "title": "Foundation Flash Applications for Mobile Devices (Foundation)", "lccn": "", "number_of_pages": "536", "openlibrary_medcover_url": "https://covers.openlibrary.org/b/id/861477-M.jpg", "subjects": "Portable computerized instruments; Flash (Computer file)", "publish_date": "December 25, 2006", "dewey_decimal_class": "", "authors": "", "id": 1237, "olid": "OL8848801M", "location": 1}, {"isbn": "9780387974958", "openlibrary_preview_url": "", "title": "Representation theory", "lccn": "90024926", "number_of_pages": "551", "openlibrary_medcover_url": "https://covers.openlibrary.org/b/id/24
@mpmckenna8
mpmckenna8 / .block
Last active June 11, 2017 18:43
Color Selection Issue
license: mit
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.js"></script>
</head>
<body>
<div id="heap">
</div>
<script src="index.js"></script>
@mpmckenna8
mpmckenna8 / .block
Last active May 29, 2017 16:53
Spinning wheel
license: mit
@mpmckenna8
mpmckenna8 / heaper.js
Last active April 8, 2018 15:15
Heap-sort visualization
// currently just not resetting parent after swap at the end of chain of stuff
// a zero in there seems like it breaks things
// var d3 = require('d3')
// This will make a heap node by node in a nice animation type thing.
var arr = [ 99,
94,
81,
75,