Skip to content

Instantly share code, notes, and snippets.

Joe Bartlett redoPop

Block or report user

Report or block redoPop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@redoPop
redoPop / sublp.sh
Last active Oct 26, 2017
Bash script to generate and open Sublime Text Projects.
View sublp.sh
#!/bin/bash
# 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
redoPop / mechanical-friends.md
Last active Dec 18, 2019
I get sentimentally attached to technology.
View mechanical-friends.md

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)
View cat.sh
#!/bin/sh
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
redoPop / README.md
Last active Jul 14, 2019
Hazel: "photo taken" custom date attribute
View README.md

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.

View keybase.md

Keybase proof

I hereby claim:

  • I am redopop on github.
  • I am redopop (https://keybase.io/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
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">
<head>
<meta name="viewport" content="width=device-width;">
<style id="ss"></style>
<style>
body {
text-align: center;
font-size: 1em;
-webkit-transform: translate3d(0,0,0);
@redoPop
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
try
tell application "System Events"
set frontApp to (name of first process whose frontmost is true)
end tell
@redoPop
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
redoPop / tzAbbr.js
Created Oct 19, 2012
JavaScript: friendly timezone abbreviations in the client ("EDT", "CST", "GMT", etc.)
View tzAbbr.js
/* Friendly timezone abbreviations in client-side JavaScript
`tzAbbr()` or `tzAbbr(new Date(79,5,24))`
=> "EDT", "CST", "GMT", etc.!
There's no 100% reliable way to get friendly timezone names in all
browsers using JS alone, but this tiny function scours a
stringified date as best it can and returns `null` in the few cases
where no friendly timezone name is found (so far, just Opera).
@redoPop
redoPop / HashFormAuthenticate.php
Created Oct 5, 2011
CakePHP 2.0 Authentication object for use with better hash methods (bcrypt, etc.)
View HashFormAuthenticate.php
<?php
App::uses('FormAuthenticate', 'Controller/Component/Auth');
class HashFormAuthenticate extends FormAuthenticate {
/**
* Find a user record given a username and unhashed password.
*
* @param string $username The username/identifier.
* @param string $password The unhashed password.
You can’t perform that action at this time.