This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
* AppleScript routines for reading and writing NSUserDefaults ("preferences") | |
* and for prompting for an API token and storing it in a NSUserDefault. | |
*) | |
-- NSUserDefaults domain and key names | |
property theDomain : "info.johnjohnston.micro-blog-fav-images" | |
property mbKeyName : "micro-api-token" | |
property cloudKeyName : "cloud-api-token" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
* Thumbnail image from Micro.blog post | |
* Creates a thumbnail from the first image present in a given Micro.blog post | |
* v1.0.7 | |
* 2019-08-18 | |
* https://gist.github.com/sardisson/e50286e17c8f2f39bfec9429ed5f46cd | |
*) | |
on run | |
-- gruber's get browser routine, with a twist to exclude non-Apple/Google browsers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* instagram-embed.css - v1.0, 3 August 2018 | |
* | |
* In your favorite user CSS tool or stylesheet, set the following rules to | |
* apply to | |
* https://*.instagram.com/* | |
* (or equivalent; the entire instagram.com domain) | |
* | |
* N.B. Your user CSS tool must be able apply CSS rules to <iframe>s, rather | |
* than only applying them based on the URL in the browser's location bar. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening php tag. | |
// Populate image title, alt-text, caption, and description on upload | |
// but only if upload is via XML-RPC (thanks Colin Walker) | |
add_action ('xmlrpc_call', 'check_new_attachment' ); | |
function check_new_attachment( $method ) { | |
if( 'metaWeblog.newMediaObject' === $method ) { | |
add_action( 'add_attachment', 'crt_set_image_meta' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Auto-linkify @names for Micro.blog */ | |
/* Add to your child theme's functions.php or your site's functionality plugin */ | |
/* You should not put this in a stock theme's functions.php because any update */ | |
/* to that theme will overwrite functions.php and this code will have to be */ | |
/* added back again. */ | |
// Props to Chris Reed for his helpful pointers to make this only run on actual posts | |
function linkify_microdotblog_names( $data ) { | |
$content = $data['post_content']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var i, elms = document.getElementsByTagName("a"); | |
var bH = window.location.href.split(location.search||location.hash||/[?#]/)[0]; | |
for (i=0; i<elms.length; i++) { | |
if (elms[i].href.lastIndexOf("javascript:", 0) === 0) { | |
elms[i].href = elms[i].href.replace("javascript:", bH+"?bookmarklet#javascript:"); | |
} | |
} | |
})(); |