Skip to content

Instantly share code, notes, and snippets.

@eeeschwartz
eeeschwartz / .gitignore
Last active May 23, 2016 19:57
Javascript-based redirects from lexingtonky.gov to next.lexingtonky.gov
node_modules/*
@eeeschwartz
eeeschwartz / lexington-geocoder.html
Last active January 8, 2016 20:17
Use esri-leaflet to geocode against Lexington's ArcGISOnline API
<!DOCTYPE html>
<html>
<head>
<title>Esri Leaflet Geocoder</title>
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<!-- Esri Leaflet -->
<script src="//cdn.jsdelivr.net/leaflet.esri/2.0.0-beta.6/esri-leaflet.js"></script>
<!-- Esri Leaflet Geocoder -->
@eeeschwartz
eeeschwartz / TermBreadcrumbBuilder.php
Last active July 16, 2018 19:14
Load breadcrumbs from a Drupal 8 node's taxonomy term
<?php
/**
* @file
* Contains \Drupal\taxonomy\TermBreadcrumbBuilder.
*/
namespace Drupal\taxonomy;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
<a href="javascript:void(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://gist.githubusercontent.com/eeeschwartz/316c5d13bba5b1e6cd8f/raw/main.js');
document.body.appendChild(jsCode);
}())">Extract Qs</a>
@eeeschwartz
eeeschwartz / P5.6---Scalable-width,-accessible-tree-map-with-min-size---using-tables-and-D3.js(v3).markdown
Created March 31, 2015 00:33
P5.6 - Scalable width, accessible tree map with min size - using tables and D3.js(v3)

P5.6 - Scalable width, accessible tree map with min size - using tables and D3.js(v3)

This Tree Map is width scalable (based on parent), pulls the data in from table cells, has a minimum size on it's smallest elements (readability) a small screen device view and is fairly accessible (can tab into and through etc).

Please note this is not yet feature complete. This is a work in progress pen...

  • Pulls data from table TD's based on class names applied to the table header.
  • Script sets a min size (basically around 1/10th the max value) for data so they're generally readable and don't end up being tiny dots next to one massive box (some data isn't even close to being similar!) - This loses a little bit of the context but makes up for it by being more readable/usable in my opinion.
  • Each cell can now be tabbed through via keyboard (will be functional links shortly) - order is dependent on table row order - firefox has a bit
/*
Bootstrap 3.1.1 namepaced to .tw-bs
E.g.
<table>
// my regular table
</table>
<div class="tw-bs">
<table>
@eeeschwartz
eeeschwartz / datapackage-ckan-index.js
Created February 19, 2015 03:28
CKAN dpm module that will datastore_upsert data rather than deleting the resource and re-inserting
var fs = require('fs')
, path = require('path')
, CKAN = require('ckan')
, parse = require('csv-parse')
, dpRead = require('datapackage-read')
;
var Pusher = function(ckanInstance, apiKey) {
this.client = new CKAN.Client(ckanInstance, apiKey);
};
@eeeschwartz
eeeschwartz / bookmarklet.html
Last active August 29, 2015 14:13
Extract descriptions for a day in harvest
<a href="javascript:void(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://gist.githubusercontent.com/eeeschwartz/7cb6dc00d6a7cba70e1e/raw/extract_harvest_notes.js');
document.body.appendChild(jsCode);
}())">Extract Time</a>

Keybase proof

I hereby claim:

  • I am eeeschwartz on github.
  • I am eeeschwartz (https://keybase.io/eeeschwartz) on keybase.
  • I have a public key whose fingerprint is 8A1B DE14 101E 084D 91C4 482A 13C7 2B1F 64A2 23CD

To claim this, I am signing this object:

@eeeschwartz
eeeschwartz / bookmarklet.html
Last active September 20, 2020 07:49
Extract questions from google form
<a href="javascript:void(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://gist.githubusercontent.com/eeeschwartz/6086efb174d6dc076fc6/raw/main.js');
document.body.appendChild(jsCode);
}())">Extract Qs</a>