Skip to content

Instantly share code, notes, and snippets.

@billygoat
billygoat / Get OF Project For Next Meeting.js
Created May 1, 2019 14:12
Example Scriptable script for creating an OmniFocus project with tasks that have dates relative to an nth weekday of the month date
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: brown; icon-glyph: apple-alt;
// share-sheet-inputs: file-url, url, plain-text;
let wom = 3
let dow = 4
var template =
`- Coordinate «month» CocoaHeads meeting @parallel(true) @autodone(false)
- Book a presenter @parallel(true) @autodone(false) @context(online) @tags(online) @due(«due» -2w 17:00) @defer(«due» -4w 00:00)
- Create the Meetup & Tweet/Slack about it @parallel(true) @autodone(false) @due(«due» -2w 17:00) @defer(«due» -2w 00:00)
@billygoat
billygoat / parameters.md
Created July 23, 2014 21:53
List of possible action parameters for Shoots & Leaves
  • Reminder
    • date
    • time
    • title
  • Message
    • date
    • time
    • title
  • Email
    • date
@billygoat
billygoat / tzawaredate.py
Last active December 16, 2015 11:49
TZAwareDate - Pelican plugin that adds two variables to Article objects date_tz: Datetime object that is timezone aware. If the post has a time zone value, it uses that. Otherwise, it applies the TIMEZONE configuration value date_utc: Datetime object that is timezone aware and adjusted to UTC.
"""
Time Zone Aware Date plugin for Pelican
================================
Adds a datetime object with the selected time zone
"""
from pelican import signals
from datetime import datetime
from dateutil import tz
@billygoat
billygoat / atom.html
Created April 21, 2013 11:53
Jinja2 template for an Atom feed.
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ SITENAME }}</title>
<link rel="alternate" type="text/html" href="{{ FEED_DOMAIN }}" />
<link rel="self" type="application/atom+xml" href="{{ FEED_DOMAIN }}/feeds/atom.xml" />
<id>{{ FEED_DOMAIN }}/</id>
{% if articles %}
{% for article in articles %}
{% if loop.first %}
<updated>{{ article.date_utc.strftime('%Y-%m-%dT%H:%I:%SZ') }}</updated>
@billygoat
billygoat / drafts.js
Last active February 26, 2024 07:03
Drafts Bookmarklet
javascript:(function(){
var w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="Title: "+pageTitle+"\nLink: "+pageUri+"\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
}
w.location.href="drafts://x-callback-url/create/?text="+encodeURIComponent(tmplt+pageSelectedTxt);
})();
javascript:(function(){
var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="Title: "+pageTitle+"\nLink: "+pageUri+"\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)
}
else {
@billygoat
billygoat / user.css
Last active December 13, 2015 18:18
CSS to kill the stupid static GIF Tumblr overlays on videos these days. Also, radar and sponsored posts killer. Also re-enables text selection.
#right_column .radar { display:none !important; }
.vjs-paused .retro_static { background-image: none !important; }
.retro_fuzz { background-image: none !important; }
.sponsored_post { display: none !important; }
* { -webkit-user-select:all !important;
-khtml-user-select:all !important;
-moz-user-select:all !important;
-ms-user-select:all !important;
user-select:all !important;
}