Skip to content

Instantly share code, notes, and snippets.

View aendra-rininsland's full-sized avatar
:shipit:
e'rry day I'm hustlin'

Ændra Rininsland aendra-rininsland

:shipit:
e'rry day I'm hustlin'
View GitHub Profile
@aendra-rininsland
aendra-rininsland / convert_google_to_d3.js
Last active August 29, 2015 14:08
Convert Google Sankey chart data to D3.js Sankey data (nodeJS)
/**
* Convert Google Sankey chart data to D3.js Sankey data (nodeJS)
* Usage: node convert_google_to_d3.js in-file.json out-file.json
*
* Requires: lodash — npm install lodash
*/
'use strict';
var _ = require('lodash');

Deis Cheat Sheet

2015 Ændrew Rininsland

This assumes running Deis on AWS. Note this is a work-in-progress.

To check fleet status

  1. Get IP of a Deis instance.
  2. Connect: ssh -i ~/.ssh/deis core@$DEIS_IP
  3. fleetctl list-units
@aendra-rininsland
aendra-rininsland / british_mps.sparql
Last active August 29, 2015 14:25
All British MPs + Birthdays
SELECT DISTINCT ?name (CONCAT(STR(YEAR(?date)),
"-",
STR(MONTH(?date)),
"-",
STR(DAY(?date))) as ?displayDate)
WHERE {
?person dcterms:subject <http://dbpedia.org/resource/Category:UK_MPs_2010%E2%80%9315>.
?person a foaf:Person.
?person dbpedia-owl:birthDate ?date.
?person rdfs:label ?name.
@aendra-rininsland
aendra-rininsland / replace_author_urls.php
Created August 21, 2015 15:36
Totally replace WordPress default author page URLs with that of custom taxonomy named "authors"
<?php
function disable_WP_author_rewrites($rules) {
$rules['author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?authors=$matches[1]&feed=$matches[2]';
$rules['author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?authors=$matches[1]&feed=$matches[2]';
$rules['author/([^/]+)/page/?([0-9]{1,})/?$'] = 'index.php?authors=$matches[1]&paged=$matches[2]';
$rules['author/([^/]+)/?$'] = 'index.php?authors=$matches[1]';
return $rules;
}
@aendra-rininsland
aendra-rininsland / somewhat_difficult_things_to_do_in_D3.md
Created September 21, 2015 09:29
D3 Intermediate - Advanced Tutorial scratchpad

Somewhat Difficult Things To Do In D3

  • Clustered groups of elements (I.e., "group x circles into y groups")
  • Hexbin maps (E.g., hexbin election constituency maps)
@aendra-rininsland
aendra-rininsland / UNHCR.json.postman_collection
Created October 2, 2015 09:34
UNHCR API Postman collection
{
"id": "21153401-a788-3abe-5fbb-54833ca0e400",
"name": "UNHCR",
"description": "Data from the UN Refugee Agency.\n\nDocs at [data.unhcr.org/wiki/index.php/API_Documentation](http://data.unhcr.org/wiki/index.php/API_Documentation).",
"order": [],
"folders": [
{
"id": "c1514c2c-f817-f8d6-b434-eacd23a9c937",
"name": "Countries",
"description": "",
@aendra-rininsland
aendra-rininsland / rfc-date-to-iso-date.xsl
Last active November 10, 2015 18:28 — forked from bzerangue/rfc-date-to-iso-date.xsl
[XSLT] Convert RFC 2822 format to ISO date format
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Name: RSS feed date format to ISO 8601
Version: 1.0
Author: Ændrew Rininsland <aendrew.rininsland@thetimes.co.uk>
Based on work by: Brian Zerangue <brian.zerangue@gmail.com>
URL: https://gist.github.com/aendrew/eaa220e619008cbb628c
N.b., currently the timezone handling is a bit screwy.
@aendra-rininsland
aendra-rininsland / .block
Last active December 12, 2022 15:17 — forked from vijithassar/README.md
one-line arrow function syntax for getter/setter methods
license: mit
@aendra-rininsland
aendra-rininsland / frame.html
Created October 12, 2016 17:55 — forked from bclinkinbeard/frame.html
D3 listener collisions across iframes
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
circle {
fill: green;
}
@aendra-rininsland
aendra-rininsland / .block
Last active October 19, 2016 10:40
fresh block
license: mit