Skip to content

Instantly share code, notes, and snippets.

cheering at clouds

Joe Bartlett redoPop

cheering at clouds
View GitHub Profile
redoPop / stream-file.ts
Last active Jan 10, 2021
Simple file streamer for Deno.
View stream-file.ts
function streamFile(path: string) {
let file: Deno.File,
iter: AsyncIterableIterator<Uint8Array>;
return new ReadableStream({
async start() {
file = await;
iter = Deno.iter(file);
redoPop /
Last active Oct 26, 2017
Bash script to generate and open Sublime Text Projects.
# Bash script to generate and open Sublime Text Projects
# If the current directory is part of a git repo, this script will
# look for a .sublime-project file in that repo root and open it.
# If no such file exists, it'll generate one based on the dir name.
# If the current directory is _not_ a git repo, no .sublime-project
# will be generated and if none is found in the current directory then
redoPop /
Last active Dec 18, 2019
I get sentimentally attached to technology.

Mechanical friends

I get sentimentally attached to technology. These are some of the mechanical friends I've made over the years:

Name Service Details
2-XL 2004-2016 iPod (Click Wheel Gen 4, 40 GB)
Eddie 2005-2008 PowerBook G4 (12" 1.5 GHz)
K9 2008-2009 MacBook Pro (15" Early 2008)
EVE 2009-2012 MacBook Pro (13" Mid 2009)
say -v cello i am a cat and i\'m small very small oh so small i am a cat and i\'m probably eating pancakes om nom nom nom nom nom nom om nom nom nom nom nom om nom nom nom nom nom nom nom om nom nom nom nom
redoPop /
Last active Jul 14, 2019
Hazel: "photo taken" custom date attribute

At the time of writing, Hazel's default date attributes all refer to an image file's creation date rather than the date on which the photo was originally taken. The two dates may differ.

This script provides a custom date attribute reflecting the time the photo was actually taken. As written, it's intended to be added as an embedded script in a "Run JavaScript" rule action, so that it's custom attribute can be used in subsequent "Sort into subfolder" patterns.

The date this script exposes is obtained via sips -g creation [filename]. It's not clear to me exactly which EXIF attribute the sips "creation" property comes from, but it seems reasonable to assume it's either DateTimeOriginal or DateTimeDigitized.


Keybase proof

I hereby claim:

  • I am redopop on github.
  • I am redopop ( on keybase.
  • I have a public key whose fingerprint is BD5E 80B7 1064 E817 8170 6D51 CF73 4474 7775 9DD1

To claim this, I am signing this object:

redoPop / anki_mobile_card.html
Created Feb 7, 2015
HTML used by AnkiMobile to render card templates; a reference for creating advanced Anki card templates with special HTML/CSS. When used by AnkiMobile, the card's HTML replaces the `<!-- (Card contents) -->` comment in this gist, with the shared styles dropped inline inside a `<style>` tag.
View anki_mobile_card.html
<!doctype html>
<html class=" webkit safari mobile iphone js">
<meta name="viewport" content="width=device-width;">
<style id="ss"></style>
body {
text-align: center;
font-size: 1em;
-webkit-transform: translate3d(0,0,0);
redoPop / file-actions.applescript
Last active May 10, 2017
Alfred workflow to show file actions for an open document.
View file-actions.applescript
on alfred_script()
-- Replace with path to dir where your nvALT notes are kept as individual files
set nvFolder to "/Users/redoPop/Dropbox/Notes"
set docPath to false
tell application "System Events"
set frontApp to (name of first process whose frontmost is true)
end tell
redoPop / gist:9050999cebcd7e50934a
Created Sep 8, 2014
IE10 & IE11 don't trigger touch events (e.g., touchstart). If you want to differentiate touches from clicks, you must use the pointer events API and the event object's pointerType property:
View gist:9050999cebcd7e50934a
function onPointerDownHandler (event) {
if (event.pointerType === 'touch') {
// Equivalent to a touchstart on MS Surface
// For IE 10
element.addEventListener('MSPointerDown', onPointerDownHandler);
// For IE 11+
redoPop / tzAbbr.js
Last active Jul 5, 2021
JavaScript: friendly timezone abbreviations in the client ("EDT", "CST", "GMT", etc.)
View tzAbbr.js
Given a date, tzAbbr returns a short, friendly name for the
user's time zone on that date, or an empty string if their
client's Intl support is missing or incomplete.
For example, a user in New York might see:
tzAbbr(new Date()) // => "EST"
Time zones are locale-dependent. Users traveling outside of