24/9/2017

Using Alfred to start a Blot draft

After a bit of experimentation, I decided to use a Unix Epoch datetime stamp (i.e. the number of seconds elapsed since 1 January 1970) as the basis for both the filename of my Blot posts, and also the permalink. It’s not the most transparent bit of information to use, but some of my posts are short status posts with no title, so it seemed the most consistent and efficient form to use.

This is fine for posts that get created via Zapier by cross-posting from other services, but when I come to create my own drafts manually, it is a bit more fiddly than I would like, as I have to get the current datetime in the Unix Epoch format.

So I decided that I would write a little script to use as part of an Alfred workflow, which would create the file in the Drafts directory, create the correct filename and corresponding Date: entry in the front matter, and then open the file in Sublime Text for editing.

My Alfred workflow to create a draft Blot postMy Alfred workflow to create a draft Blot post

It’s pretty simple. I use a keyword (‘nsd’ for new Slipstream draft, in my case) to run the following Python code:

#!/usr/local/bin/python3

from datetime import datetime
import sys

query = "{query}"

now = datetime.utcnow()
drafts_dir = "/Users/bsag/Dropbox/Apps/Blot/Drafts"

u_stamp = now.strftime("%s")
f_name = "{0}/{1}.txt".format(drafts_dir, u_stamp)

date_tag = now.strftime("%Y-%m-%d %H:%M:%S")
date_tag = "Date: {0}\n".format(date_tag)
type_tags = "Type: post\nTags: {0}\n\n".format(query)

front_matter = date_tag + type_tags

with open(f_name, 'w+') as f:
    f.write(front_matter + '\n')

sys.stdout.write(f_name)

I enter the comma separated tags I want to use in the Tags: field in the Alfred command window, after the keyword, and these get passed to the script via the query variable. At the end of the script, the full filepath is passed to stdout, and then the Open File action opens that file with Sublime Text.

It works really nicely, and could be adapted to pre-enter more information in the draft. I love Alfred workflows for this kind of thing: it’s really easy to cobble together a little workflow that makes tasks like this a bit easier.

post coding
24/9/2017

I’m So Excited!, 2013 - ★★★★

Farce on a plane!

There’s a lot to enjoy in this film, and one rather unacceptable scene which - had the genders of the participants been reversed - would have been considered totally unacceptable.

That’s the one sour note in a film that is otherwise a total romp. It’s over the top, unbelievable, and mostly hilarious. I might have to find a clip of the business class stewards doing their Pointer Sisters dance routine to cheer myself up in dark times.

Read full review on Letterboxd

films
17/9/2017

New post about my recent visit to the Pitt Rivers Museum: http://d.pr/UAuObN

links bsag
17/9/2017

Ladilikan by Trio Da Kali & Kronos Quartet

If you’d like some beautiful, transporting music for a peaceful Sunday morning, you cannot do better than listen to this stunning album, which mixes traditional griot Malian music from Trio Da Kali with subtle and sympathetic string support from the Kronos Quartet. Hawa Kassé Mady Diabate’s vocals are gorgeous, and the balafon (played by Lassana Diabaté) and bass ngoni (played by Mamadou Kouyaté) blend wonderfully well with the Western string quartet. I will definitely look out for more recordings from Trio Da Kali.

world music
17/9/2017

Embrace of the Serpent, 2015 - ★★★★★

A dream-like dual story of two Western explorers, separated by 40 years or so, enlisting the help of Karamakate (brilliantly played by Nilbio Torres and Antonio Bolivar) to find a rare plant. Both want to find this plant to heal them in different ways, though both are exploiting the knowledge of Karamakate and his people and the resources of Amazonia. If you’re a Westerner, it’s hard to watch this film without feeling acute sorrow and shame for the havoc we have wreaked, environmentally and culturally on the region, and for what we continue to do.

Dreams play a major role in the film. Evan (the later explorer) cannot dream, and persuades Karamakate to let him take a plant-derived drug to try to dream, but that doesn’t work for him. Karamakate sees the two Western men as one person divided in time, and by the time he meets the later explorer (Evan) he has partially lost his memory and his sense of himself, having lived so long alone. The film is also concerned with cultural misunderstandings. Karamakate wants the men to shut up and open themselves up to the wisdom of the forest. At one point, Theo (the earlier explorer), as a go at paddling the canoe, hacking the paddle into the water as if he’s trying to kill it. Karamakate tells him to slow down, and that the river will tell him when he needs to paddle, if he will only listen. But the scientists, while sympathetic and open to other cultures in many ways, can’t really begin to understand this approach to the world around them. Karamakate cannot understand why they burden themselves with so much baggage (literally, but also metaphorically), even though Theo tries to explain that his notebooks and specimens are the only link to his wife and family, and the only proof of the things he has seen (in effect, that it wasn’t all a dream).

The film is a sad depiction of a long history of exploitation, incomprehension, distrust and betrayal, but in the end it also manages to be an uplifting portrayal of trust and friendship across a cultural divide.

Read full review on Letterboxd

films
17/9/2017

Amazing, it works! You just need to set up the Zapier Alfred workflow, as explained on the Zapier blog - https://zapier.com/blog/zapier-for-alfred/.

links bsag