Skip to content

Instantly share code, notes, and snippets.

View ginader's full-sized avatar

Dirk Ginader ginader

View GitHub Profile
@kerryrodden
kerryrodden / README.md
Last active January 18, 2021 11:05
Zoomable sunburst with updating data

I combined Mike Bostock's Zoomable Sunburst and Sunburst Partition examples, so that I could have both zooming and updating the underlying data (between count and size, in this case). A simple combination of the examples does not work; you have to edit the arcTween function used for updating the data, so that when it redraws the partition layout, it takes account of the current zoom level by adjusting the domain of the x scale.

Click on any arc to zoom in, and click on the center circle to zoom out. Use the Size/Count radio buttons to update the data.

@chrisrzhou
chrisrzhou / README.md
Last active October 19, 2017 09:32
D3 Sunburst Sequence

D3 Sunburst Sequence

bl.ocks.org link

D3 Sunburst Sequence visualizes a graph of nodes by highlighting sequential progression of nodes leading up to a final value. A sunburst sequence is useful to visualize relative weights/percentages of a starting state to an end state (e.g. webpage redirects, product retention, subscription-based products, cashflows).


Description

@saw
saw / gist:d826c410c6c7f75d27ba
Last active August 29, 2015 14:17
Switch iterm2 profile per host
# for this to work you need to create
# a profile for each host, or set of hosts or whatever.
# to make sure it is always current add this to your
# PROMPT_COMMAND so it runs every time, rather just at login.
if [ "$HOSTNAME" = "myhost1" ]; then
echo -ne "\033]50;SetProfile=myhost1\007"
fi
if [ "$HOSTNAME" = "myhost2" ]; then
@rnalexander
rnalexander / gist:e3a5068c0f4a31de0534
Last active August 29, 2015 14:23
Miso Stew Recipe

Ingredients:

  • 1 250g(ish) block of furm tofu, cut into small cubes
  • 250g(ish) baby new potatoes, cut into 8ths
  • 100g(ish) cognichelli pasta (tiny shells, sometimes called soup pasta)
  • 1 medium onion, finely minced
  • 1/2 head of garlic, crushed and minced
  • Olive oil
  • Toasted Seasame Oil
  • 100-150g White miso paste (depends on taste)
  • 2-3 cubes vegan vegitable sock cubes (I use Knorr generally)
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 28, 2025 16:43
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@function up-to($list, $index) {
$l: ();
@each $e in $list {
@if length($l) < $index {
$l: append($l, $e, list-separator($list));
}
}
@return $l;
}
@paulirish
paulirish / what-forces-layout.md
Last active May 12, 2025 16:18
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@daneden
daneden / Instructions.md
Created December 1, 2015 00:25
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
@aaronash
aaronash / script.cocoascript
Created March 20, 2016 22:43
Simple example Sketch plugin script to export layers into json data. This was an experiment. It's not pretty.
// Sketch export layers to json script
// This was hacked together for experimentation purposes, the code is ugly.
// logs:
// tail -f /var/log/system.log | grep Sketch
//I only later realized that there are methods to get the parent or children
//layers... oops. Seriously, I just threw this together.
function makeChildrenArray(layerGroup, dict, allLayers) {
// log("called makeChildrenArray for " + layerGroup)
// result = new Array()
@marcysutton
marcysutton / chrome-a11y-experiment-instructions.md
Last active February 10, 2025 06:23
Enable Chrome Accessibility Experiment

NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y


Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.

As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)

To enable the accessibility inspector in Chrome stable: