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
View gist:dcb0400c7b72078f6671
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,
@aholachek
aholachek / flare.json
Last active January 19, 2016 13:42
draggable partition
View flare.json
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@aholachek
aholachek / README.md
Last active May 25, 2016 02:52
Accessible D3 Line Chart with the HTML Audio API + JQuery DataTables
View README.md

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.

View hopper-widget.js
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
View gist:3b3c80b4e3726880f8f86dfd7173d626
".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
View sample_snippets.cson
".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
View .script-compiled.js
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}
}
@aholachek
aholachek / .script-compiled.js
Last active May 24, 2017 07:59
Animated Grouped/Stacked Bar Transitions
View .script-compiled.js
/*eslint no-undef: 0*/
function createChart (svg, data) {
// //normalize data
// Object.keys(data).forEach((d)=>{
// ["0", "1", "2", "3", "4", "5", "6"].forEach(k=>{
// if (d[k] === undefined) d[k] =
// })
// })