Skip to content

Instantly share code, notes, and snippets.

View doc22940's full-sized avatar

Acampbell doc22940

View GitHub Profile
@doc22940
doc22940 / README.md
Created May 10, 2020 22:21 — forked from veltman/README.md
Automatic label placement along a path #2

A method for automatically finding the best eligible label position and font size for a label that's going to go along a path inside of an area, similar to this example but with two embellishments:

  • Using d3plus.polygonRayCast() to more accurately measure the vertical clearance available at a given x position with any rotation.
  • Avoiding label positions that would cause the text to be overlapped by another shape for a case like this bump chart.

The measurement gets thrown off a little bit by the curve function and the fact that text is rotated letter by letter instead of continuously, but the results seem good enough.

See also: Automatic label placement along a path Streamgraph label positions #2

@doc22940
doc22940 / README.md
Created May 10, 2020 22:19 — forked from veltman/README.md
Departures board
@doc22940
doc22940 / README.md
Created May 10, 2020 22:18 — forked from veltman/README.md
Departures board (slow)
@doc22940
doc22940 / feuds.csv
Created May 10, 2020 22:15 — forked from veltman/feuds.csv
Bios with feuds, excluding professional wrestlers
name category
Drake Rappers
50 Cent Rappers
Lil Wayne Rappers
Kendrick Lamar Rappers
Jay-Z Rappers
Foxy Brown Rappers
Nas Rappers
Queen Latifah Rappers
Meek Mill Rappers
@doc22940
doc22940 / introrx.md
Created May 3, 2020 17:13 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@doc22940
doc22940 / Append to File.js
Created April 18, 2020 10:52 — forked from simonbs/Append to File.js
Appends text to a file. To be used with Shortcuts.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: file-signature;
let text = args.shortcutParameter
let fm = FileManager.iCloud()
let filePath = args.fileURLs[0]
let content = fm.readString(filePath)
let newText = content + "\n" + text
fm.writeString(filePath, newText)
Script.complete()
@doc22940
doc22940 / Import Shortcut Links.js
Created April 18, 2020 10:51 — forked from simonbs/Import Shortcut Links.js
Reads a text file containing iCloud links to shortcuts and imports the shortcuts into the Shortcuts app
@doc22940
doc22940 / Create Gist.js
Created April 18, 2020 10:50 — forked from simonbs/Create Gist.js
Scriptable script for creating a gist.
// To use this script, you need to configure an OAuth App on GitHub.
// Follow the instructions on the link below to create your OAuth App.
//
// When you are asked to put in a redirect URL, you should put the URL for running this script in Scriptable. Assuming the name of this script is "Create Gist", the URL is scriptable:///run?scriptName=Create%20Gist
//
// https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
//
// Now that you have an app, you can run this script. The script will prompt you to enter the client ID and client secret you got after creating the app on GitHub.
// Keychain key for the GitHub OAuth App client ID
@doc22940
doc22940 / flatten.js
Created April 9, 2020 20:28 — forked from alexjlockwood/flatten.js
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: http://jsfiddle.net/xqq5w/embedded/result/
Basic usage example: http://jsfiddle.net/Nv78L/3/embedded/result/
@doc22940
doc22940 / icloud_tabs_to_csv.sh
Created April 9, 2020 17:33 — forked from ziadoz/icloud_tabs_to_csv.sh
Export iCloud Tabs/URLS to CSV
sqlite3 ~/Library/Safari/CloudTabs.db "select ctd.device_name || ',' || ct.title || ',' || ct.url from cloud_tabs as ct inner join cloud_tab_devices as ctd on ctd.device_uuid = ct.device_uuid order by device asc, position asc" > icloud_tabs.csv