Skip to content

Instantly share code, notes, and snippets.

In the desert

Stephen Howells stephenhowells

In the desert
View GitHub Profile
View gist:6604943
<title>S3 POST Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
var bucketName = 'MY_BUCKET_NAME';
var AWSKeyId = 'MY_AWS_KEY_ID';
var policy = 'MY_POLICY';
var signature = 'MY_SIGNATURE';
stephenhowells / no_widows.rb
Last active Dec 21, 2015
Remove widows in your blog post headings by adding an "&nbsp;" between the last two words in the title if it is three words or more.
View no_widows.rb
def no_widows(arg)
if arg.strip.count(" ") >= 2
arg.split[0...-1].join(" ") + "&nbsp;#{arg.split[-1]}"
#Example usage:
View Bcrypt.php
By Marco Arment <>.
This code is released in the public domain.
Usage example:
// In a registration or password-change form:
stephenhowells / gist:5496740
Created May 1, 2013
CDNs fail, but your scripts don't have to - fallback from CDN to local jQuery
View gist:5496740
<script src=""></script>
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='/js/jquery-2.0.0.min.js' type='text/javascript'%3E%3C/script%3E"));
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

View .tmux.conf
# Set prefix command to Ctrl-a
set -g prefix C-a
unbind C-b
# Reduce tmux delay for more responsiveness
set -sg escape-time 1
# Window and pane index count starts in 1 rather tan 0
set -g base-index 1
setw -g pane-base-index 1
stephenhowells / ia-writer_marked.applescript
Last active Apr 5, 2020
iA Writer AppleScript to preview text in Marked.
View ia-writer_marked.applescript
-- Preview the currently active iA Writer document using Marked.
tell application "iA Writer"
-- Ask iA Writer for it's active document.
set the_document to document 1
-- Save the document or prompt if not previously saved.
save the_document
stephenhowells / private.xml
Last active Dec 11, 2015
View private.xml
<?xml version="1.0"?>
<name>Swap OPTION_L and COMMAND_L</name>
<autogen>--KeyToKey-- KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
<autogen>--KeyToKey-- KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
stephenhowells / gist:4539225
Created Jan 15, 2013
Sublime config 1-15-13
View gist:4539225
"auto_complete": true,
"auto_indent": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "smooth",
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
stephenhowells / gist:4091072
Created Nov 16, 2012
reload shell settings
View gist:4091072
. ~/.bash_profile
. ~/.zshrc