Skip to content

Instantly share code, notes, and snippets.


John Johnston troutcolor

View GitHub Profile
troutcolor / micoblog_functions.php
Last active Aug 10, 2020
functions that have do with and microblogging that live in my child theme's functions.php
View micoblog_functions.php
<?php // Opening PHP tag - nothing should be before this, not even whitespace
updated 2018-01-29
this is just the stuff I've added to my child theme's function php
Hopefully most of the credits are noted below
troutcolor /
Last active Dec 15, 2019
#script to download pile of flickr images and make a movie like the pummelvision service # example #needs ffmpeg sox & jhead #needs sips so a mac I think
#2018 additions
#needs jhead which I installed with homebrew
#jhead auto rotates images according to the exif Orientation which ffmpeg does not respect
#if the photos do not need rotated then you could remove the jhead line below
#sox to loop audio. I installed with homebrew
#my video was longer than the audio, I just create a loop of 3 with sox and use that. Could up the number iif you have more photos than me
troutcolor / Notes-Export-to-HTML.scpt
Last active Sep 16, 2019
Export a folder to html with page breaks for printing. Used as a starter.
View Notes-Export-to-HTML.scpt
set htmltop to "<!doctype html>
<html lang=\"en\">
<meta charset=\"utf-8\">
<title>Notes Export</title>
@media print {
hr {
page-break-after: always;
troutcolor /
Last active Apr 12, 2019
This is a script for alfred to post to a WordPress, adding the category micro, post format status and as a note. There is no title. I use a hotkey cmd-alt-cnrl-m alfred passes the selected text in the topmost app to the script as q. I don't deal with special chars. Password hard coded is probably not a good idea. Obviously you could edit categor…
on alfred_script(q)
set myBlogUsername to "USERNAME"
set myBlogPass to "PASSWORD"
set cat to {category:{"Micro"}, kind:{"note"}}
set poststrut to {post_type:"post", post_status:"publish", post_format:"status", post_title:"", post_content:q, terms_names:cat, comment_status:"open"}
tell application ""
set myPosts to call xmlrpc {method name:"wp.newPost", parameters:{"1", myBlogUsername, myBlogPass, poststrut}}
return myPosts
end tell
end alfred_script
troutcolor /
Last active Feb 10, 2019
AppleScript Get your favourites from find photos and make thumbnail grid needs JSON Helper and an app token from your account
* Inspired by smokey
* url for thubnail from @smokey too
* html Thumbnail image griid from favs
* NEEDS JSON Helper free from
* Needs a App token from
* updated to use cloudimage you need a token from iin CLOUDIMAGETOKEN below.
troutcolor / OnThisDay.php
Last active Feb 1, 2019
simple shortcode plugin to display posts from the current day. I put it in a folder onthisday inside my plugins folder. Then make a page and add [onthisday] NB thewre are a few problems with thiis, use instead.
View OnThisDay.php
There are some problems with this, use instead.
* Plugin Name: OnThisDay
* Description: shortcode for posts on the current day
* Version: 0.1
* Author: John Johnston
* Mostly borrowed from
troutcolor / feed-microcast.php
Created Aug 6, 2018
WordPress RSS feed template for my microcast
View feed-microcast.php
* RSS2 Feed Template for displaying RSS2 Posts feed.
* Modified for microcast
* Based on template found
$numposts = 50; // number of posts in feed
$posts = query_posts('showposts='.$numposts.'&cat=652');
troutcolor / downloadWordPressMedia.scpt
Created Jun 2, 2018
downloads media from WordPress site using AppleScript and the REST API
View downloadWordPressMedia.scpt
--needs json helper for apple script Free from mac app store
set downloadfolder to POSIX path of (choose folder with prompt "Please select an output folder:")
set pagecountstart to 1
set pagecountmax to 1
set perpage to 10 --MAX =100
set blogurl to "FILL-IN-THE-URL"
troutcolor / pinboardToLinks.scpt
Created Oct 20, 2017
An appleScript that pulls recent links from pinboard, make a html list from the and opens in BBEdit ready to edit and post to blog. lins in the description beginning with > are made into blockquotes.
View pinboardToLinks.scpt
troutcolor / quicknote.js
Created Sep 24, 2017
Make a new browser window where you can type. I run from bookmarket or via FastScripts
View quicknote.js'data:text/html, %3Chtml%20contenteditable%3E%3Cstyle%3E%2A%7Bfont-size%3A20px%7D%3C%2Fstyle%3E','_blank')
//'data:text/html, <html contenteditable><style>*{font-size:20px}</style>','_blank')
You can’t perform that action at this time.