Skip to content

Instantly share code, notes, and snippets.

@andrewlkho
andrewlkho / gist:fe6c48671fdb15148fb1
Last active August 29, 2015 14:13
LaTeX footer for notes
\usepackage[iso,british]{isodate}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
\cfoot{\footnotesize\thepage}
\rfoot{\footnotesize{}ALKH/\today}
@andrewlkho
andrewlkho / gist:76f10a79066f7e2730b2
Created April 23, 2015 18:11
List solarized colours in Terminal
print -P "%F{234}base03\n%F{235}\n%F{240}base01\n%F{241}base00\n%F{244}base0\n%F{245}base1\n%F{254}base2\n%F{230}base3\n%F{136}yellow\n%F{166}orange\n%F{124}red\n%F{125}magenta\n%F{61}violet\n%F{33}blue\n%F{37}cyan\n%F{64}green"
@andrewlkho
andrewlkho / gist:6f3ed6d32e8f1071e62f
Created May 20, 2015 19:51
How to edit RAW files produced by Fujifilm XQ1 in Photos (OS X)

OS X does not, as of May 2015, support the RAW (*.RAF) files produced by the Fujifilm XQ1. The easiest way to edit them is to download the Adobe Camera RAW and DNG Converter. This can be used to convert RAF files into DNG files. Importantly, "Compatibility" must be set to "Camera Raw 6.6 and later". The default setting of "Camera Raw 7.1 and later" creates files that OS X cannot handle.

> Custom quix command file
>
> For the syntax of this file, see http://quixapp.com/syntax/
#kill-defaults
@ Andrew's custom commands
a http://www.amazon.co.uk/gp/search?url=search-alias%3Daps&field-keywords=%s Amazon UK
dabs http://www.dabs.com/search?q=%s Dabs
dict http://dictionary.reference.com/browse/%s Dictionary
@andrewlkho
andrewlkho / python-find.py
Created October 31, 2010 04:38
Recursively search a specified path for matching files. This is the pythonic equivalent of `find /path -name '*.html'`
import os
import os.path
import fnmatch
results = []
for root, dirs, files in os.walk("/path"):
results.extend([os.path.join(root, file) for file in files
if fnmatch.fnmatch(file, "*.html")])
@andrewlkho
andrewlkho / post-receive
Last active November 11, 2015 01:41
Deploying jekyll (on a Joyent Shared Accelerator)

This was originally posted on 2010-12-29 to http://andrewho.co.uk/weblog/deploying-jekyll-on-a-joyent-shared-accelerator

This website is based on [jekyll][] (a static site generator). I store the text files for jekyll in a git repository. Here is how I setup automatic deployment of this website. Whilst a lot of this post is generally applicable, some of it (specifically the installation section) is only of relevance if, like me, you are hosted on a [Joyent][] Shared Accelerator.

Before we get started, just note that the git repository storing my website is a bare one in ~/git/design/andrewho.co.uk.git. I'll assume you're happy creating such

@andrewlkho
andrewlkho / gist:10739728
Created April 15, 2014 15:02
Deploying jekyll on TextDrive

This was originally posted on 2012-12-13 to http://andrewho.co.uk/weblog/deploying-jekyll-on-textdrive

This post is an update to "[Deploying jekyll (on a Joyent Shared Accelerator)][old-article]".

This website is based on [jekyll][], a static site generator. I host the files for this in a bare git repository on a [TextDrive][] shared server. Here is the procedure I use to automatically deploy the site whenever I push to master. The paths used below will obviously be specific to where I have placed things. I use a bare git repository in ~/git/andrewho.co.uk.git and deploy to

@andrewlkho
andrewlkho / letter.tex
Last active December 26, 2015 11:29
Basic template for a letter in LaTeX
\documentclass[10pt]{article}
\usepackage{minibox}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@andrewlkho
andrewlkho / gist:7364227
Last active December 27, 2015 17:39
Clean up YouTube

Here is how I make the viewing experience on YouTube that little bit more pleasant (using Safari).

Firstly, I opt-in to the YouTube HTML5 trial which replaces Flash videos with H.264.

Next, I install the [A Cleaner Internet][2] Safari extension which declutters a lot of the site.

Finally, I apply a stylesheet which removes the "You need to upgrade your Adobe Flash Player" warning that appears when flash is not installed (user.css). If a video requires flash then I open it in Google Chrome using the "Open With..." part of the Develop menu.

@andrewlkho
andrewlkho / gist:7442103
Last active December 28, 2015 04:19
Some files associated with my TaskPaper setup
<theme>
<!-- Define solarized colours -->
<color id="base03" red="0.000" green="0.169" blue="0.212" alpha="1.0" />
<color id="base02" red="0.027" green="0.212" blue="0.259" alpha="1.0" />
<color id="base01" red="0.345" green="0.431" blue="0.459" alpha="1.0" />
<color id="base00" red="0.396" green="0.482" blue="0.514" alpha="1.0" />
<color id="base0" red="0.514" green="0.580" blue="0.588" alpha="1.0" />
<color id="base1" red="0.576" green="0.631" blue="0.631" alpha="1.0" />
<color id="base2" red="0.933" green="0.910" blue="0.835" alpha="1.0" />
<color id="base3" red="0.992" green="0.965" blue="0.890" alpha="1.0" />