Skip to content

Instantly share code, notes, and snippets.

View jasonferrier's full-sized avatar
👨‍💻

Jason Ferrier jasonferrier

👨‍💻
View GitHub Profile

Web Mapping

Introduction

New to web mapping? Go through this online presentation to get a nice intro to the technology:

https://maptime.io/anatomy-of-a-web-map/

NOTE: A few pieces of this is a bit dated, but the core concepts are still how things are done.

A deeper dive

scenario tenure usage solar_adopter income avg_bills_level
Model_Run_A Renter Low Non-adopter Lowest 66.24501596149938
Model_Run_A Renter Low Non-adopter Moderate 71.56755904077203
Model_Run_A Renter Low Non-adopter Middle 74.03720690286845
Model_Run_A Renter Low Non-adopter High 76.26706497987249
Model_Run_A Renter Low PV Adopter Lowest
Model_Run_A Renter Low PV Adopter Moderate
Model_Run_A Renter Low PV Adopter Middle
Model_Run_A Renter Low PV Adopter High
Model_Run_A Renter Low All Lowest 66.24501596149938
@jasonferrier
jasonferrier / console.js
Created May 3, 2023 14:34
Show message in Browser Dev Tools Console when opened
/*
* Taken from Material UI documentation:
* https://github.com/mui/material-ui-docs/blob/af5e109990a26318c96dbff6f25759ba91f0e147/docs/pages/_app.js#L112
*
* The `%c` directive in the text output of the `log()` instance method applies CSS to the text AFTER the directive
* See documentation section "Styling console output" at the following link
* https://developer.mozilla.org/en-US/docs/Web/API/console#outputting_text_to_the_console
*/
if (typeof window !== 'undefined' && process.env.NODE_ENV === 'production') {
{
"type" : "FeatureCollection",
"features" : [
{
"type" : "Feature",
"geometry" :
{
"type" : "Polygon",
"coordinates" :
[
#!/bin/bash
#
# Requires:
# - gdal_sieve.py
# - ogr2ogr (GDAL)
# - topojson (node.js)
# Grab the relative directory for source file.
# SRC_DIR=`dirname $0`
@jasonferrier
jasonferrier / 20190821_campsite_boundingBox.geojson
Created August 21, 2019 20:49
2019-Aug-21: Campsite extents
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jasonferrier
jasonferrier / error
Created July 14, 2018 20:59
json 1.8.3 build error
Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/jasonferrier/.rvm/gems/ruby-2.4.1/gems/json-1.8.3/ext/json/ext/generator
/Users/jasonferrier/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180714-56946-1kwvjb6.rb extconf.rb
creating Makefile
current directory: /Users/jasonferrier/.rvm/gems/ruby-2.4.1/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
Actually take the time to get educated on idiomatic React and best practices.
**Step Zero**
- [X] https://www.lullabot.com/articles/how-to-learn-react
- [X] https://www.lullabot.com/articles/why-choose-react
- [X] https://www.youtube.com/watch?v=0ZNIQOO2sfA
**Step One**
- [x] https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
- [x] Quick Start - https://reactjs.org/docs/installation.html
@jasonferrier
jasonferrier / Multiselect.js
Created July 13, 2018 17:56
Reproduce syntax highlighting bug
/* Copied from JedWatson/react-select/master/examples/src/components/Multiselect.js on 2018-July-13 11:55:55 MDT */
import React from 'react';
import createClass from 'create-react-class';
import PropTypes from 'prop-types';
import Select from 'react-select';
const FLAVOURS = [
{ label: 'Chocolate', value: 'chocolate' },
{ label: 'Vanilla', value: 'vanilla' },
{ label: 'Strawberry', value: 'strawberry' },