Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active June 11, 2024 21:02
U.S. Population Density
license:gpl-3.0
height:680
border:no
@jbencina
jbencina / CSPAN-transcript-parser.py
Last active January 7, 2021 20:09
Quick (and dirty) Python script that takes the transcript information from CSPAN video pages and parses it into a JSON file with the time stamp, speaker name, and speech text. There are probably 100 more elegant ways to write this, but it works for what I needed.
from html.parser import HTMLParser
import re
import json
import datetime as dt
class Entry():
def __init__(self, time):
self.time = ''
self.time_base = time
self.speaker = ''
@gka
gka / multi-crowbar.js
Last active April 29, 2021 21:44
like svg-crowbar, but for multiple svg elements!
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
*/
@shawnbot
shawnbot / README.md
Last active October 17, 2017 05:55
Bar charts in Sketch? Yep.

This is a Sketch script to make bar charts.

bars

Here's how to run it:

  1. Make a selection of only shapes with names in the format:
(anything)value={number}
@jstcki
jstcki / .block
Last active August 10, 2018 04:37
Interpolate anything with React Motion
license: mit
@yang-wei
yang-wei / destructuring.md
Last active November 3, 2024 16:23
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@1wheel
1wheel / circle-lattice.js
Last active June 6, 2021 05:59
Circle Aliasing
var width = 500,
height = 500,
r = 450
var svg = d3.select('html')
.append('svg')
.attr({width: width, height: height})
.append('g')
.translate([10, height - 10])

Quick log of a refactoring pattern I've been using lately. Function.bind lets you curry methods, which is useful for throwing in more parameters to functions called outside of your control, like in functional Array methods or callbacks.

For instance:

window.setTimeout(function() {
  foo.bar(baz);
}, 10);
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active November 10, 2024 05:28
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@0XDE57
0XDE57 / config.md
Last active October 20, 2024 13:07
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".