View track
#!/bin/bash | |
trap stop SIGINT SIGHUP | |
usage() { | |
track=`basename $0` | |
echo "usage: $track <time> <name> [--quiet]" | |
} | |
# Validate usage |
View visual mode keep selections
" make < > shifts keep selection | |
vnoremap < <gv | |
vnoremap > >gv |
View relative line numbers
" relative line numbers | |
set relativenumber | |
autocmd InsertEnter * :set number | |
autocmd InsertLeave * :set relativenumber |
View Todo.txt to Omnifocus
set p to "<Path to todo.txt>" | |
set l to paragraphs of (do shell script "grep . " & p) | |
do shell script ">" & p | |
tell app "OmniFocus" to tell document 1 | |
repeat with v in l | |
make new inbox task with properties {name:v} | |
end repeat | |
end tell |
View pretty-code-editor.php
<?php | |
class Pretty_Code_Editor { | |
function __construct() { | |
add_action( 'admin_print_styles', array( $this, 'editor_styles' ) ); | |
add_action( 'admin_print_footer_scripts', array( $this, 'tabs' ) ); | |
} | |
function editor_styles() { ?> |
View UnfullscreenAll.scpt
tell application "System Events" | |
repeat with p in (every process whose visible is true) | |
try | |
my setFullScreen(displayed name of p, 0, true) | |
end try | |
end repeat | |
end tell | |
(* | |
Sets the fullscreen status for either the front window or all windows of the specified, *AppleScript-enabled* application. |
View .zshrc
ssh-copy-id() { | |
USER=$(whoami) | |
USAGE="Usage: `basename $0` [-i FILE] user@host" | |
FILE="$HOME/.ssh/id_rsa.pub" | |
if [ $# -lt 1 ]; then | |
echo "$USAGE" | |
fi | |
View Hazel-secure-files.applescript
-- Set password and file name | |
set itemPath to quoted form of (POSIX path of theFile) | |
set passwd to do shell script "openssl rand -base64 32" | |
set hash to do shell script "openssl sha1 " & itemPath & " | awk -F'= ' '{print $2}'" | |
-- set file name | |
tell application "Finder" | |
set file_name to name of theFile | |
set file_name to text 1 thru ((offset of "." in file_name) - 1) of file_name | |
set file_ext to name extension of theFile |
OlderNewer