This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSAppleScript+RunHandler.h | |
// astest | |
// | |
// Created by Rob Wells on 30/01/2014. | |
// Copyright (c) 2014 Rob Wells. All rights reserved. | |
// | |
#ifndef kASAppleScriptSuite | |
#define kASAppleScriptSuite 'ascr' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- By Rob Wells for the Morning Star | |
on open theStories | |
repeat with aStory in theStories | |
tell application "TextWrangler" | |
open aStory | |
tell the front text document | |
set encoding to "Unicode (UTF-8)" | |
educate quotes with replacing target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Open current Safari URL in Chrome | |
-- | |
-- Forked from https://gist.github.com/3153606 | |
-- which was forked in turn from https://gist.github.com/3151932 | |
tell application "System Events" | |
-- Check if Chrome is running | |
set chromeRunning to ((name of processes) contains "Google Chrome") | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -euf -o pipefail | |
cd $HOME/Desktop/ | |
rm -r 'imac-setup' || true | |
mkdir -p 'imac-setup' | |
cd 'imac-setup' | |
xcode-select --install || true | |
curl -s --show-error https://bootstrap.pypa.io/get-pip.py | sudo /usr/bin/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import re | |
import sys | |
area_codes = [ | |
'020', '023', '024', '028', '029', '0113', | |
'0114', '0115', '0116', '0117', '0118', '0121', | |
'0131', '0141', '0151', '0161', '0191', '01200', | |
'01202', '01204', '01205', '01206', '01207', '01208', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
""" | |
Print the date of the next or last specified weekday. | |
Usage: | |
dayshift next <weekday> [--format=<fmt> --inline] | |
dayshift last <weekday> [--format=<fmt> --inline] | |
Options: | |
--format=<fmt>, -f <fmt> A strftime format string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import sys | |
import re | |
input_text = sys.stdin.read() | |
regex_24 = re.compile(r'''\b | |
([01][0-9]|2[0-3]) # Hour (00-23) | |
([0-5][0-9]) # Mins (00-59) | |
\b''', flags=re.VERBOSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import re | |
import subprocess | |
os.chdir('/tmp') | |
with open(os.environ['BB_DOC_PATH']) as full_file: | |
sub_copy, orig_copy = re.split(r'#{2,} original copy #{2,}', | |
full_file.read(), flags=re.I) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
bb_doc_arr = sys.stdin.readlines() | |
first_line = bb_doc_arr[0].rstrip('\n') | |
underline = '\n' + '=' * len(first_line) + '\n' | |
bb_doc_arr[0] = first_line + underline | |
print(''.join(bb_doc_arr), end='') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo 'usage: scat FILE [...]' | |
fi | |
for arg in "$@"; do | |
echo "===> $arg:" | |
cat -n "$arg" | |
echo |
NewerOlder