Skip to content

Instantly share code, notes, and snippets.

@LayneSmith
LayneSmith / mapbox-gl.md
Last active April 4, 2019 21:08
Steps for embedding mapbox-gl in an ES6 build system

In terminal navigate to project and run npm install -S mapbox-gl

Insert import mapboxgl from 'mapbox-gl'; at top of scripts.js

In scripts.js initialize map with

// GET MAP STARTED
const map = new mapboxgl.Map({
  container: 'map', // Div ID, where to put it in DOM. <div id="map"></div> for example

style: 'https://maps.dallasnews.com/styles.json', // link to custom styles

@johndhancock
johndhancock / ooyala-overrides.scss
Created September 12, 2017 15:23
Style overrides for ooyala player in interactives
.video-block {
width: 55%;
margin: 4.8rem 0;
font-size: 15px;
img {
max-width: 170px !important;
max-height: 18px !important;
}
}
.video-wrapper {
// helper functions
var getJSON = function (nameOfFile) {
var dataFile = File(docPath + '/' + nameOfFile + ".json");
dataFile.open();
data = dataFile.read();
data = eval(data);
dataFile.close();
return data;
};
@hobbes7878
hobbes7878 / acs-example.R
Created December 13, 2016 15:36
A simple example showing how to fetch census data with the acs package in R
library(dplyr)
# Load acs library
# Complete docs at https://cran.r-project.org/web/packages/acs/acs.pdf
library(acs)
# First, create a geography
# For example, all counties in Texas
tx.counties = geo.make(county="*", state='TX')
# Or all tracts in Dallas and Tarrant county, using fips code
@achavez
achavez / README.md
Last active July 11, 2019 14:52
Development machine setup

Prerequisites

  1. Run all of the OS updates that are available
  2. Install Homebrew and tap the casks we'll need (brew tap homebrew/cask-fonts, brew tap homebrew/cask-versions)

Shell setup

  • install ZSH - brew install zsh
  • set ZSH as the default shell by 1) adding the output of which zsh to /etc/shells and 2) changing the default shell with chsh -s $(which zsh)
  • add autocompletion to ZSH brew install zsh-autosuggestions (be sure to follow the instructions output by brew to update your ~/.zshrc)
  • later, after installing Node install a cool command prompt like spaceship (more here) - npm install -g spaceship-prompt
@willurd
willurd / web-servers.md
Last active April 20, 2025 00:42
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000