Skip to content

awhite.ca

Cambridge area web developer

Category Archives: Code Snippet

Archiving Sent Mail with imapfilter

My “sent” folders are a morass. I think that’s true of most folks. I wrote a little script in my imapfilter config.lua to duplicate some handy functionality from the venerable pine. I’m sure it could be cleaned up a bit, but it does the job for me. On the first of the month, it creates […]

Posted byAndrewAugust 5, 2015August 5, 2015Posted inCode Snippet, ProductivityTags: imapfilter, mail, organization

Editing the hosts file on Windows

I have to Google this once a week. It doesn’t stick. At least this way, maybe I’ll find my own site when I Google. The easiest thing to do is create a shortcut on the desktop. It should point to notepad.exe C:\Windows\System32\drivers\etc\hosts Then run this shortcut as an administrator whenever you need to add a […]

Posted byAndrewMarch 31, 2015Posted inCode SnippetTags: testing, web development, windows

The bash function I should have written years ago

I bet you nine times out of ten when you mkdir whatever, the next thing you do is cd whatever. Add this to your bash profile. function mcd() { mkdir $1 cd $1 } Run mcd whatever at the shell prompt, and you’ll find yourself in a brand new directory called whatever.

Posted byAndrewJuly 25, 2013Posted inCode SnippetTags: bash

Use DNS prefetching to speed up web font loading

Poking around in a framework today, I saw they’d suggested using the new dns-prefetching feature in HTML5 to speed up resolving some foreign domains. Further digging showed folks are prefetching the domains from which Google serve their web fonts. It’s a great idea, given that web fonts are one of the biggest contributors to page […]

Posted byAndrewJuly 17, 2013Posted inCode SnippetTags: google, html, html5, web fonts

Convert .webloc files to a Markdown list

I have a bunch of bookmarks I was keeping in folders on my Mac as .webloc files. I still want the bookmarks, but I don’t want all these tiny files cluttering up my drive, so I wrote a quick script called webloc2md. The script takes a single argument, the target directory, and outputs the links […]

Posted byAndrewFebruary 6, 2013Posted inCode SnippetTags: cli, markdown, php

Posts navigation

1 2 3 Older posts
awhite.ca, Proudly powered by WordPress.