Skip to content

Instantly share code, notes, and snippets.

View trinary's full-sized avatar

Erik Cunningham trinary

View GitHub Profile
@codebykat
codebykat / destroy-blue-lines.css
Last active December 22, 2015 23:39 — forked from max/gist:6472731
Hides "conversation view" on Twitter while still preserving the ability to click to expand conversation. This works for me on Chrome.
.conversation-module > li:after, .conversation-module > li:before {
display: none;
}
ol.conversation-module li.conversation-root,
ol.conversation-module li.conversation-ancestor {
display: none;
}
li.js-has-navigable-stream.open ol.conversation-module li.conversation-root,
@seliopou
seliopou / d3-transform-chaining.md
Last active December 15, 2015 16:09
A discussion of the API behavior of d3-transform.

d3-transform chaining

An unnecessarily thorough analysis

The Methods of d3.selection

When you look at the behavior of the methods on a d3.selection, they fall into one of two categories:

  • those that create a new selection, e.g., .filter(), .exit(), .enter(), .append(), etc.; and
  • those that mutate the existing selection, e.g., .attr(), .style(), on(), etc.

Question: Are these categories disjoint and exhaustive?

Instead of adding methods to d3.selection, make a transform its own object that you can define independently of a selection. So this...

d3.selectAll("g.label")
  .translate(function(d) { return [20,d.x*10]})
  .rotate(40)
  .scale(function(d) {return [d.size,2]})

... would turn into this:

@gus
gus / index.txt
Created November 30, 2009 21:55 — forked from toothrot/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation: