Skip to content

Instantly share code, notes, and snippets.

View stephenhowells's full-sized avatar
🏜️
In the desert

Stephen Howells stephenhowells

🏜️
In the desert
View GitHub Profile
@stephenhowells
stephenhowells / remap.xml
Created October 4, 2012 15:03
Keyboard Remap XML
<?xml version="1.0"?>
<root>
<item>
<name>Swap OPTION_L and COMMAND_L</name>
<identifier>private.swap_OPTION_L_and_COMMAND_L</identifier>
<autogen>--KeyToKey-- KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
<autogen>--KeyToKey-- KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
</item>
<item>
@stephenhowells
stephenhowells / gist:4021772
Created November 6, 2012 01:10
Apache conf snippet to hide .git directories and .gitignore files.
# do not allow .git version control files to be issued
<Directorymatch "^/.*/\.git+/">
Order deny,allow
Deny from all
</Directorymatch>
<Files ~ "^\.git">
Order allow,deny
Deny from all
</Files>
@stephenhowells
stephenhowells / gist:4083924
Created November 16, 2012 04:00
show colors in Git
git config --global color.ui true
@stephenhowells
stephenhowells / gist:4091072
Created November 16, 2012 21:27
reload shell settings
#bash
. ~/.bash_profile
#zsh
. ~/.zshrc
@stephenhowells
stephenhowells / gist:4539225
Created January 15, 2013 15:00
Sublime config 1-15-13
{
"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
stephenhowells / private.xml
Last active December 11, 2015 07:49
KeyRemap4MacBook
<?xml version="1.0"?>
<root>
<item>
<name>Swap OPTION_L and COMMAND_L</name>
<identifier>private.swap_OPTION_L_and_COMMAND_L</identifier>
<autogen>--KeyToKey-- KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
<autogen>--KeyToKey-- KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
</item>
<item>
@stephenhowells
stephenhowells / ia-writer_marked.applescript
Last active November 21, 2022 23:07
iA Writer AppleScript to preview text in Marked.
-- Preview the currently active iA Writer document using Marked.
tell application "iA Writer"
activate
-- 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
# 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

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@stephenhowells
stephenhowells / gist:5496740
Created May 1, 2013 17:25
CDNs fail, but your scripts don't have to - fallback from CDN to local jQuery
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js"></script>
<script>
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='/js/jquery-2.0.0.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>