Skip to content

Instantly share code, notes, and snippets.

@sdbernard
sdbernard / colorbrewer.js
Last active November 2, 2017 17:47
d3 module2
var colorbrewer={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8
@sdbernard
sdbernard / index.html
Last active November 12, 2015 10:48
d3 module 3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How far does Isis’ influence extend?</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Raleway:100normal,200normal,300normal,400normal,500normal,600normal,700normal,800normal,900normal|Open+Sans:400normal|Lato:400normal|Roboto:400normal|Oswald:400normal|Droid+Sans:400normal|Droid+Serif:400normal|Lobster:400normal|PT+Sans:400normal|Ubuntu:400normal|Playfair+Display:400normal&amp;subset=all" rel="stylesheet" type="text/css">
<style type="text/css">
@sdbernard
sdbernard / eumigration.json
Created November 22, 2015 16:33
d3 module 4
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sdbernard
sdbernard / gist:22e5b582371c0e717cacacb6030b04c0
Created November 23, 2016 12:29
Query for OSM overpass API for difference between dates
[diff:"2007-01-1T00:00:00Z","2015-12-31T23:59:00Z"];
(
way[building]({{bbox}});
);
out body;
>;
out skel qt;
@sdbernard
sdbernard / census-pop-new.csv
Last active March 29, 2019 18:15
dataset for census population
We can't make this file beautiful and searchable because it's too large.
name,year,value,lastValue
Abbeville-AL,1790,0,0
Abbeville-AL,1800,0,0
Abbeville-AL,1810,0,0
Abbeville-AL,1820,0,0
Abbeville-AL,1830,0,0
Abbeville-AL,1840,0,0
Abbeville-AL,1850,0,0
Abbeville-AL,1860,0,0
Abbeville-AL,1870,0,0
date key value
15/03/2020 Africa 1
16/03/2020 Africa 1
17/03/2020 Africa 1.6
18/03/2020 Africa 2
19/03/2020 Africa 1.9
20/03/2020 Africa 2.7
21/03/2020 Africa 4.1
22/03/2020 Africa 5.1
23/03/2020 Africa 6.3
Popular / Aboutanonymous’s Block 4e461aaf002f921375a0af4cd3b0c293
Updated June 16, 2017
Simple stream + interpolation, layout offset & axes
Open
forked from devgru's block: Simple stream + interpolation, layout offset & axes
index.html#
<!DOCTYPE html>
<meta charset='utf-8'>
@sdbernard
sdbernard / jun-temps.R
Created July 12, 2024 14:35
Global surface air temperature anomalies
library(needs)
needs(tidyverse, readxl, googlesheets4, stringr, plotly, magrittr, janitor, RcppRoll, lubridate, ggrepel, zoo, scales, rvest, jsonlite, splitstackshape, ncdf4)
options(scipen = 20)
#############
############# GLOBAL TEMP
#############
#Load in data
@sdbernard
sdbernard / hurricane-melissa.R
Created October 31, 2025 14:24
Download satellite imagery from Nasa's GOES satellite
library(needs)
needs(tidyverse, readxl, googlesheets4, stringr, plotly, magrittr, janitor, RcppRoll, lubridate, ggrepel, zoo, scales, rvest, sf,raster)
options(scipen = 20)
# Specify the URL of the webpage
url <- "https://cdn.star.nesdis.noaa.gov/GOES19/ABI/SECTOR/car/GEOCOLOR/"
# Read the HTML content of the page
page <- read_html(url)