Skip to content

Instantly share code, notes, and snippets.

View aholachek's full-sized avatar

Alex Holachek aholachek

View GitHub Profile
@aholachek
aholachek / gist:dcb0400c7b72078f6671
Created September 23, 2014 14:54
Querying solr using requests library
SOLR_PATH = 'http://localhost:9000/solr/select/'
def query_solr(q = '', start = 0, rows = 200, fl = 'bibcode,title,recid,citation_count,year,property', sort = "date desc"):
d = {'q' : q,
'sort': sort,
'fl' : fl,
'start' : start,
'rows' : rows,
gistup
@aholachek
aholachek / flare.json
Last active January 19, 2016 13:42
draggable partition
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@aholachek
aholachek / README.md
Last active June 17, 2024 13:59
Calendar Day View Layout

##D3 Calendar Day View Layout

This script demonstrates a layout algorithm I developed for a day calendar view. The height and y-axis placement of each calendar item are solely determined by its start and end times, but the width and x-axis placement of each item is dependent on how many other items occur during the same time as it.

You can change the layout by adding items using the form to the left, or clicking on items to remove them.

###There are three main steps for the layout calculation:

@aholachek
aholachek / README.md
Last active July 10, 2018 15:58
Sankey with animated gradient links
@aholachek
aholachek / README.md
Last active May 25, 2016 02:52
Accessible D3 Line Chart with the HTML Audio API + JQuery DataTables

Please use the "open block" link to the right to open in a new window, as the current view cuts off an important section of the page.

define([
'js/components/api_targets',
'js/components/api_request',
'js/widgets/base/base_widget',
'hbs!./templates/hopper_template',
'bootstrap'
], function(
ApiTargets,
ApiRequest,
BaseWidget,
@aholachek
aholachek / gist:3b3c80b4e3726880f8f86dfd7173d626
Last active December 9, 2016 21:40
Better HTML Starter Snippet for Atom
".text.html, .text.php":
"template":
"prefix": "html"
"body": """
<!DOCTYPE html>
<html lang="en-us" class="no-js">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset="utf-8">
<title>
@aholachek
aholachek / sample_snippets.cson
Last active April 6, 2017 19:56
Sample snippets.cson for Atom
".source.js":
"Mocha it()":
"prefix": "it("
"body": "it('$1', () => {$2})"
"functional component":
"prefix": "functional component"
"body": """
import React, {PropTypes} from 'react'
@aholachek
aholachek / .script-compiled.js
Last active May 21, 2017 10:39
Continuous Scale Exploration
var svg = d3.select('svg')
var margin = {top: 40, right: 40, bottom: 40, left: 40}
var width = svg.attr('width') - margin.left - margin.right
var height = svg.attr('height') - margin.top - margin.bottom
var g = svg.append('g').attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')
var data = d3.range(100000).map(function (n){
if (n % 1000 === 0){
return { x : n, y : n}
}