Skip to content

Instantly share code, notes, and snippets.

View wdehaes's full-sized avatar

Willem Dehaes wdehaes

View GitHub Profile
@jonatin
jonatin / rbenv-rebuild.sh
Created February 10, 2014 23:59
rbenv, re-build all installed versions
for ruby in $(ls ~/.rbenv/versions/) ; do
echo $ruby
rbenv uninstall -f $ruby
rbenv install $ruby
done
@squarism
squarism / iterm2.md
Last active July 25, 2024 20:15
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@thomaswilburn
thomaswilburn / writeup.md
Last active January 16, 2024 03:33
Creating a document minimap with SVG

One of my favorite no-so-secret weapons for data visualization on the web is the SVG viewBox attribute. I've written about it before: in my textbook, I have a whole chapter on art direction with viewBox, and I also talk about it in the section on rendering SVG from JS.

Essentially, the viewBox attribute lets you set up the... view box. SVG works on a 2d coordinate system that can (but doesn't have to) match the CSS positioning grid for an element. You can use the attribute to tell the SVG to set an offset for the rendering canvas, to zoom in or out, or to crop the image to keep an area in view while still fitting in an arbitrary aspect ratio (similar to how object-fit and object-position work in CSS, but more granular).

But on a recent project, I also had a chance to use viewBox as a literal view box: for a [Votebeat story](https://arizona.votebeat.org/2022/10/18/23410059/ma