Skip to content

Instantly share code, notes, and snippets.

View kardeiz's full-sized avatar

Jacob Brown kardeiz

View GitHub Profile
@kardeiz
kardeiz / gist:3941080
Created October 23, 2012 19:40
d3 data array to summary object (e.g., "SELECT x, count(*) FROM y GROUP BY x")
// This may not be the most efficient way to do this, but it's pretty clean
var yourObject = d3.nest()
.key(function(d) { return d; })
.rollup(function(d) { return d.length; })
.map(yourArray);
// e.g.,
// var input = ["this","is","a","test","for","this","method"];
// var output = {"this":2,"is":1,"a":1,"test":1,"for":1,"method":1}
@kardeiz
kardeiz / gist:3959343
Created October 26, 2012 15:12
Convert relative links to absolute in HTML
#!/usr/bin/env ruby
# encoding: utf-8
# This works pretty well, but can't yet go up dir tree
# Also doesn't work on JS generated hrefs/srcs
# I was surprised there wasn't a ready-made solution online (that I could quickly find)
require 'open-uri'
require 'nokogiri'
require 'active_support/core_ext'
@kardeiz
kardeiz / cni12f.md
Created December 16, 2012 15:42
CNI Fall 2012 Meeting

CNI Fall 2012 Meeting


Website: Fall 2012 Meeting
Twitter: #cni12f

Disclaimer 1: These notes provide my perception and understanding of the CNI conference presentations. It is possible that errors were made in the reporting or that speaker statements have been inadvertently misrepresented.

@kardeiz
kardeiz / gist:4323126
Created December 17, 2012 22:46
d3 fragments for stacked charts
<html>
<head>
<title>Sankey Diagram</title>
<script src="../assets/d3.v2.js"></script>
<script src="../assets/sankey.js"></script>
<script src="../assets/jquery-1.8.3.min.js"></script>
<script src="../assets/underscore.js"></script>
<script src="../assets/underscore.nest.js"></script>
<script src="../assets/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
@kardeiz
kardeiz / README.md
Created December 20, 2012 16:27 — forked from mbostock/.block

Switch between stacked and grouped layouts using sequenced transitions! Animations preserve object constancy and allow the user to follow the data across views. Animation design by Heer and Robertson. Colors and data generation inspired by Byron and Wattenberg.

@kardeiz
kardeiz / gist:4355671
Last active December 10, 2015 01:08
catalog js
(function(){
if (typeof jQuery=='undefined') {
var headTag = document.getElementsByTagName("head")[0];
var jqTag = document.createElement('script');
jqTag.type = 'text/javascript';
jqTag.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js';
jqTag.onload = (function(){ myJQueryCode(jQuery); });
headTag.appendChild(jqTag);
} else {
@kardeiz
kardeiz / marc2dspacedc.xsl
Last active December 13, 2017 16:50
Convert MARCXML to collection of DSpace Dublin Core nodes (for dublin_core.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Derived from imlsdcc.grainger.uiuc.edu/docs/stylesheets/GeneralMARCtoQDC.xsl -->
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
<xsl:template name="subfieldSelect">
<xsl:param name="codes"/>
<xsl:param name="delimeter">
<xsl:text> </xsl:text>
</xsl:param>
<xsl:variable name="str">
<xsl:for-each select="marc:subfield">
@kardeiz
kardeiz / gist:4514649
Created January 11, 2013 22:49
blah js for later
<html>
<head>
<title>Charts</title>
<!-- <script src="../assets/d3.v2.js"></script> -->
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="../assets/sankey.js"></script>
<script src="../assets/jquery-1.8.3.min.js"></script>
<script src="../assets/underscore.js"></script>
<script src="../assets/underscore.nest.js"></script>
<script src="../assets/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.js"></script>
@kardeiz
kardeiz / README.md
Last active December 11, 2015 14:09 — forked from mbostock/.block

This stacked area chart is constructed from a TSV file storing the market share of several popular web browsers over the last year. Data is from Clicky Web Analytics. The chart employs conventional margins and a number of D3 features:

@kardeiz
kardeiz / resume.md
Last active December 18, 2015 02:09
Résumé

Jacob Brown

[email protected]
214/223-1654


EDUCATION

M.S., Information Science (Digital Imaging). University of North Texas. December 2011. (4.0 GPA.)