Skip to content

Instantly share code, notes, and snippets.

@pwc3
pwc3 / ExtractMarkdownFromVoodoopad.py
Created August 29, 2013 01:07
Python script to extract Markdown from a VoodooPad file used for static blog generation.
#!/usr/bin/env python
import argparse
import codecs
import glob
import os
import plistlib
import re
import sys
@pwc3
pwc3 / alfred-shell-script.sh
Created August 16, 2013 03:13
Alfred workflow shell script
# set interpreter to /bin/bash
case "{query}" in
"monday") code="12345#,,#" ;;
"wednesday") code="23456#,,#" ;;
"friday") code="34567#,,#" ;;
*) code="{query}#,,#" ;;
esac
$HOME/bin/skypecall "800-555-1212" "$code"
@pwc3
pwc3 / skypecall.py
Created August 16, 2013 02:46
Python script for Mac OS X to call a number in Skype then send an arbitrary DTMF string.
#!/usr/bin/env python
# Idea taken from:
# http://community.skype.com/t5/Mac/Re-Pause-option-when-dialing/td-p/731820
import argparse
import codecs
import re
import subprocess
import sys
@pwc3
pwc3 / edit-plist.py
Created August 6, 2013 01:17
Opens a property list file in a text editor, converting from binary if necessary.
#!/usr/bin/env python
import argparse
import subprocess
import sys
EDITOR = 'vim'
BINARY = 'Apple binary property list'
XML = 'XML document text'
@pwc3
pwc3 / Exchange Sync.applescript
Last active February 1, 2024 12:34
AppleScript to copy all of the events from an Exchange calendar to an iCloud calendar.
tell application "Calendar"
-- delete everything from the destination calendar
-- TODO: Change "Destination Calendar" to be the name of your destination calendar
repeat with anEvent in (get events of calendar "Destination Calendar")
delete anEvent
end repeat
-- copy all events from the source calendar to the destination
-- TODO: Change "Source Calendar" to be the name of your source calendar
-- TODO: Change "Destination Calendar" to be the name of your destination calendar
@pwc3
pwc3 / gist:5078925
Created March 3, 2013 23:44
Type checking assignments.
NSDictionary *aDictionary = nil;
NSArray *anArray = nil;
void (^aBlock)() = ^{ };
// no warning
aDictionary = aBlock;
// no warning
anArray = aBlock;
// warning assigning NSArray to NSDictionary, but not for block assignment
aDictionary = anArray = aBlock;
@pwc3
pwc3 / SkypeMenuUpdater.rb
Created May 18, 2012 23:42
Shows the number of unread Skype conversations in the menu bar
#!/usr/bin/env ruby
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"
GDB = IO.popen("gdb", "w")
def gdb(cmd)
GDB.puts cmd
GDB.flush
end