Skip to content

Instantly share code, notes, and snippets.

@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 / index.html
Last active April 20, 2023 06:14
Poisson disc distribution image sample of a tacocat
<!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="main.js"></script>
@mpmckenna8
mpmckenna8 / index.html
Created February 25, 2014 18:57 — forked from ilyabo/index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery.tipsy.js"></script>
<link href="tipsy.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="chart"></div>
@mpmckenna8
mpmckenna8 / brazilWor.json
Last active April 11, 2022 03:18
d3 data() to load brazil w/ cities map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mpmckenna8
mpmckenna8 / index.html
Last active November 11, 2020 08:47
Multiple Pop-ups using leaflet.js
<!DOCTYPE html>
<html>
<head>
<title>Multiple concurrent popups w/ leaflet</title>
<script type="text/javascript" src="./maptimes4leaflet.json" ></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://leaflet.cloudmade.com/dist/leaflet.ie.css" /><![endif]-->
<script type="text/javascript" src="http://maps.stamen.com/js/tile.stamen.js?v1.2.3"></script>
@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 July 21, 2017 16:46 — forked from baramuyu/.block
D3.js v4 Gantt Chart, example 3
license: mit
@mpmckenna8
mpmckenna8 / heaper.js
Created April 4, 2017 23:37
Vertical Tree diagram with v4 and collapsing and expanding
var numbs = [ 4, 7, 8, 2, 3, 1, 23 ]
var margin = {top: 20, right: 90, bottom: 30, left: 90},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var i = 0,
duration = 750,
root;
@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,
@mpmckenna8
mpmckenna8 / index.html
Created April 1, 2017 23:00
Topojson on a leaflet map
<html>
<head>
<link rel="stylesheet" href="./style.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://unpkg.com/topojson-client@3"></script>
</head>
<body>