Skip to content

Instantly share code, notes, and snippets.

@ramnathv
ramnathv / concaveman.R
Created May 2, 2017 03:58
Using Concaveman in R using V8
# Using concaveman in R using V8
concaveman <- function(d){
library(V8)
ctx <- v8()
ctx$source('https://www.mapbox.com/bites/00222/concaveman-bundle.js')
jscode <- sprintf(
"var points = %s;var polygon = concaveman(points);",
jsonlite::toJSON(d, dataframe = 'values')
)
ctx$eval(jscode)
const regl = require('regl')({
extensions: 'OES_texture_float'
})
const LAPLACIAN_SHADER = `
vec4 laplacian (sampler2D img, vec2 id, float DX) {
return -texture2D(img, id) + 0.25 * (
texture2D(img, id + DX * vec2(-1, 0))
+ texture2D(img, id + DX * vec2(1, 0))
+ texture2D(img, id + DX * vec2(0, -1))
@mbostock
mbostock / .block
Last active June 17, 2017 12:10
Stacked-to-Multiples
license: gpl-3.0
@mbostock
mbostock / .block
Last active September 3, 2017 11:18
Concurrent Transitions
license: gpl-3.0
@mbostock
mbostock / .block
Last active September 12, 2018 10:49
TopoJSON Parallax
license: gpl-3.0
@biovisualize
biovisualize / index.html
Last active October 15, 2018 01:29
D3.js Reusable Bar Chart with Angularjs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
@blacki
blacki / dev-environment.md
Last active June 14, 2019 00:19
Managing a Python Dev Environment w/ Virtual Env

Dev Environment

I do the following on a per project basis.

Install virtualenv

If you don't have virtualenv installed, install it globally by running pip install virtualenv from any folder. If that didn't work because you have no pip try pip3 install virtualenv instead.

Create a new python for the project

// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
% Overview figure for
% ``Combating human trafficking with multimodal deep models,''
% submitted to ACL 2017.
% Figure by William Chargin; send any comments to wchargin@gmail.com.
\documentclass[margin=2mm]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}