Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active September 11, 2024 10:57
Prim’s Algorithm III
license: gpl-3.0
@miguelmota
miguelmota / base64-to-png.js
Created September 24, 2014 21:33
Base64 to PNG in Node.js
var fs = require('fs');
var path = require('path');
function base64ToPNG(data) {
data = data.replace(/^data:image\/png;base64,/, '');
fs.writeFile(path.resolve(__dirname, '../tmp/image.png'), data, 'base64', function(err) {
if (err) throw err;
});
}
@adilapapaya
adilapapaya / examples.R
Last active August 29, 2015 14:19 — forked from skranz/s_dplyr
# Examples
library(dplyr)
source("s_dplyr.R");
# Original usage of dplyr
mtcars %>%
filter(gear == 3,cyl == 8) %>%
select(mpg, cyl, hp:vs)
# Select user specified cols.
@jakebathman
jakebathman / StateBoundaries.sql
Last active November 1, 2025 07:48
The approximate max/min latitude and longitude for all states and major territories
-- Create the table
CREATE TABLE IF NOT EXISTS `StateBoundaries` (
`State` varchar(10) DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`MinLat` varchar(50) DEFAULT NULL,
`MaxLat` varchar(50) DEFAULT NULL,
`MinLon` varchar(50) DEFAULT NULL,
`MaxLon` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@Fil
Fil / .block
Last active February 2, 2025 02:38
Fabio Crameri’s Colormaps
license: mit
@willwade
willwade / commands.md
Last active June 6, 2026 08:09
Apple iOS Voice Control commands list. These are the default ones listed in the settings. If you are looking for the Catalina commands Ron Leblanc has compiled a great list (https://www.dropbox.com/s/stacghczr68o8az/Voice%20Control%20Commands.xlsx?dl=0)