Skip to content

Instantly share code, notes, and snippets.

View newsroomdev's full-sized avatar

Gerald Rich newsroomdev

View GitHub Profile
@wboykinm
wboykinm / labels.mss
Created August 25, 2014 17:32
"Afternoon Satellite" - Mapbox "Satellite Afternoon", tweaked a bit.
// Languages: name (local), name_en, name_fr, name_es, name_de
@name: '[name_en]';
@sans: 'Mark Offc Pro Regular', 'Arial Unicode MS Regular';
@sans_it: 'Mark Offc Pro Italic', 'Arial Unicode MS Regular';
@serif_md: 'Mark Offc Pro Bold', 'Arial Unicode MS Regular';
@sans_bold: 'Mark Offc Pro Bold', 'Arial Unicode MS Regular';
#country_label {
@caged
caged / index.html
Last active January 16, 2020 10:24
Plot vector points on a cropped raster image with d3.js
<!doctype html>
<meta charset="utf-8">
<body>
<style media="screen">
body {
margin: 0;
}
.supermarket {
fill: red;
@mbostock
mbostock / .block
Last active September 30, 2016 16:15
Reprojecting CSV with ogr2ogr
license: gpl-3.0
@d3noob
d3noob / .block
Last active January 13, 2022 22:58
Dynamic historical stock data with d3.js and YQL
license: mit
@ashaw
ashaw / sankey.js
Last active August 29, 2015 13:56
var Sankey = function(opts) {
this.opts = opts;
this.el = $("#" + this.opts.el);
this.graphsReady = 0;
this.graphWidth = this.el.width();
};
Sankey.prototype.initPaper = function() {
this.paper = Raphael(document.getElementById(this.opts.el));
};
@mikemorris
mikemorris / coffee.geojson
Last active March 26, 2018 01:02
via:geojson.io
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbalter
benbalter / geojson-conversion.sh
Last active April 23, 2024 13:16
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
@caged
caged / index.html
Last active January 16, 2020 14:08
TopoJSON via MapBox & Leaflet
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<div id="map"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://api.tiles.mapbox.com/mapbox.js/v1.0.3/mapbox.js"></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.3/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@dsparks
dsparks / kmeans_palette.R
Last active June 27, 2019 00:10
Image Manipulation, Part 2
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("jpeg", "reshape2", "ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Image URL:
allImageURLs <- c("http://media.charlesleifer.com/blog/photos/thumbnails/akira_940x700.jpg",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Official_portrait_of_Barack_Obama.jpg/441px-Official_portrait_of_Barack_Obama.jpg",
"http://cache.boston.com/universal/site_graphics/blogs/bigpicture/obama_11_05/obama22_16604051.jpg",
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });