Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Strayer nstrayer

View GitHub Profile
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@couchand
couchand / README.md
Last active Sep 15, 2016 — forked from mbostock/.block
Adjustable ranges on color scale
View README.md

An example illustrating a scale that allows the ranges to be adjusted by the user.

This example is based on this one.

This example demonstrates how to construct a key from a threshold scale, in the style of Ford Fessenden’s map of police stops involving force. A linear scale is used to set the x-position of each colored rectangle in the key. There is one rectangle per color in the threshold scale’s range, and one tick per value in the threshold scale’s domain. The linear scale’s domain sets the implied extent of the key, here spanning 0 to 100%.

@noamross
noamross / google_wordcloud.R
Created Apr 22, 2015
Create a wordcloud of your google search history
View google_wordcloud.R
# Script to make a word cloud of your google searches. Get your google search
# history at http://history.google.com. This script assumes the JSON files
# exported are in a 'Searches' subfolder
library(jsonlite)
library(rlist)
library(magrittr)
library(stringi)
library(wordcloud)
library(tm)
@robert-moore
robert-moore / README.md
Last active Jan 17, 2021
A New Pattern for Updatable D3.js Charts
View README.md

Using a new updatable chart format. Update functions are made accessible to the caller, handing over chart controls with full functionality to the caller in a modular manner. Data binding is done with method chaining, like any other configuration variable, and can be changed after initialization. This allows for changes to be rendered in the context of chart history, leveraging D3's transitions and update logic.

@klmr
klmr / list_comprehension.r
Created Feb 12, 2016
Haskell-like list comprehension for R
View list_comprehension.r
# Dummy object, only required for name resolution.
set = structure(list(), class = 'set')
print.set = function (x, ...) invisible(x)
`[.set` = function (set, expr, filter) {
expr = substitute(expr)
filter = substitute(filter)
stopifnot(identical(expr[[1]], quote(`<-`)))
stopifnot(identical(expr[[2]][[1]], quote(`|`)))
@ejb
ejb / .block
Last active Nov 15, 2020
Structuring D3 code with constructor functions
View .block
license: mit
@tonyhschu
tonyhschu / .block
Last active Dec 22, 2020
Small Scroll-linked Animation Demo
View .block
scrolling: yes
license: MIT
@nbremer
nbremer / README.md
Last active Jun 18, 2016
Color blending - Hexagon
View README.md

This is the first example of my blog on Beautiful color blending effects with SVGs & D3

The hexagon introduction to the Color blending section of my OpenVis 2016 talk "SVGs beyond mere shapes". In this example the circles are given the mix-blend-mode of screen to get nice effects when the circles overlap each other.

Another color blending example can be found here

Built with blockbuilder.org

@gka
gka / multi-crowbar.js
Last active Apr 29, 2021
like svg-crowbar, but for multiple svg elements!
View multi-crowbar.js
var multiCrowbar = (function() {
/*
* SVG Export
* converts html labels to svg text nodes
* will produce incorrect results when used with multi-line html texts
*
* Author: Gregor Aisch
* based on https://github.com/NYTimes/svg-crowbar/blob/gh-pages/svg-crowbar-2.js
*/
@nbremer
nbremer / .block
Last active Dec 4, 2019
Brushable Horizontal Bar Chart - V
View .block
height: 540