Skip to content

Instantly share code, notes, and snippets.

@darrenjaworski
darrenjaworski / .jshintrc
Created July 25, 2016 19:58
default .jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@darrenjaworski
darrenjaworski / index.html
Last active July 6, 2016 16:15
Graph Algorithm Viz
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Graphs Viz</title>
<style>
body {
max-width: 55em;
margin: 0 auto;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.min.css">
</head>
<body>
<button onclick="drawTree.init()">Recreate tree!</button>
@darrenjaworski
darrenjaworski / index.html
Last active October 31, 2017 21:12
Oklahoma State Parks.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Oklahoma State Parks</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.18.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.18.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@darrenjaworski
darrenjaworski / index.html
Last active March 31, 2016 16:46
web design nightmare (SLIDER IN A SLIDER)
<html>
<head>
<title>web design nightmare</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.9/slick.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.9/slick-theme.min.css"/>
<style>
body {
background: purple;
color: white;
font-size: 1.5em;
@darrenjaworski
darrenjaworski / index.html
Last active March 25, 2016 03:19
Horizontal Treemap
<!DOCTYPE html>
<html lang="en" class="page">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>horizontal treemap</title>
<style>
body {
margin: 0;
}
@darrenjaworski
darrenjaworski / colorbrewer.js
Last active March 8, 2016 14:28
Oklahoma voting precincts
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
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: {
@darrenjaworski
darrenjaworski / README.md
Last active February 15, 2017 13:12
Textured choropleth

These textures are a lot of fun. Here is a choropleth using a few predefined textures on some random data.

@darrenjaworski
darrenjaworski / functions.php
Last active February 15, 2016 17:46
use custom field suite with wp-api
<?php
add_action( 'rest_api_init', 'example_add_cfs' );
/**
* Add cfs fields to api call for post type example
* Fields will be put in cfs object in json
* @param none
*
* @return null
@darrenjaworski
darrenjaworski / index.html
Created January 15, 2016 22:55
coffee shops in okc
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#map {
position: absolute;
top: 0;
bottom: 0;