Skip to content

Instantly share code, notes, and snippets.

View anglepoised's full-sized avatar

Paul Love anglepoised

View GitHub Profile
{
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::*"
},
{
@anglepoised
anglepoised / gist:3246093
Created August 3, 2012 08:57 — forked from wesbos/gist:1476820
PhantomJS Screenshot
var page = new WebPage(),
address, output, size;
address = "http://www.metachunk.com/";
width = 1024; height = 600;
output = "./screenshots/wat-"+width+"X"+height+".png";
page.viewportSize = { width: width, height: height };
if (phantom.args.length === 3 && phantom.args[1].substr(-4) === ".pdf") {
@anglepoised
anglepoised / gist:3238459
Created August 2, 2012 16:37 — forked from benshimmin/gist:3238456
How to extract all links and link text from a Markdown file using pandoc
-- adapted from <http://johnmacfarlane.net/pandoc/scripting.html>
import Text.Pandoc
import Text.Pandoc.Shared (stringify)
extractURL :: Inline -> [String]
extractURL (Link txt (u,_)) = [stringify txt ++ " : <" ++ u ++ ">"]
extractURL (Image _ (u,_)) = [u]
extractURL _ = []
extractURLs :: Pandoc -> [String]
@anglepoised
anglepoised / html_compile.py
Created August 1, 2012 17:19 — forked from rolo/html_compile.py
Python script to compile .shtml files with server side includes down to flat HTML suitable for hosting on S3 or where SSIs aren't supported.
#! /usr/bin/env python
import os
import re
import shutil
from os.path import splitext
SOURCE = os.getcwd() + "/www/"
TARGET = os.getcwd() + "/compiled/"
if not os.path.exists(TARGET):
@anglepoised
anglepoised / pimp_prompt.sh
Created February 17, 2011 09:51 — forked from jamiew/pimp_prompt.sh
pimp_prompt() for bash
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')
[ "$REV" ] || return
[ "$(svn st)" ] && DIRTY=' *'
echo "(r$REV$DIRTY)"