Skip to content

Instantly share code, notes, and snippets.

View CraigWilliams's full-sized avatar

Craig Williams CraigWilliams

  • ClearCollab, LLC
  • Fort Smith Area
View GitHub Profile

Keybase proof

I hereby claim:

  • I am craigwilliams on github.
  • I am craigwilliamz (https://keybase.io/craigwilliamz) on keybase.
  • I have a public key whose fingerprint is 28A3 07C3 5CBB EBE4 8B22 5336 DB45 C6D6 AE1F 22C0

To claim this, I am signing this object:

tell application "Mail"
tell item 1 of message viewers
set selectedMessages to selected messages
repeat with aMessage in selectedMessages
bounce aMessage
delete aMessage
end repeat
end tell
delete every message in trash mailbox
end tell
@CraigWilliams
CraigWilliams / advance_skim_nlines.applescript
Created April 16, 2012 13:57
Advance Skim n number of lines - Great for reading eBooks
tell application "System Events"
set current_processes to name of processes whose frontmost is true
set current_process to item 1 of current_processes
end tell
activate application "Skim"
tell application "System Events"
tell process "Skim"
repeat 120 times
keystroke (ASCII character 31)
@CraigWilliams
CraigWilliams / edit_in_textmate.rb
Created February 20, 2011 05:11
Xcode - Edit current document in TextMate
#!/bin/sh
editWithTextmate=`/usr/bin/osascript <<EOT
tell application "Xcode"
tell active project document
tell window 1
set docPath to associated file name
end tell
end tell
end tell
@CraigWilliams
CraigWilliams / pragma_mark.rb
Created February 20, 2011 04:54
Xcode - Wraps selected text with comment and pragma mark
#!/usr/bin/ruby
var = STDIN.read.upcase
print "
//---------------------------------------------
// #{var}
//---------------------------------------------
#pragma mark -
#pragma mark #{var}\n\n"
function ignore_git () {
cat > .gitignore <<DOC
log/*.log
tmp/*
tmp/**/*
doc/api
doc/app
db/*.sqlite3
*.swp
*~
void WriteStringToPasteboard(NSString *string)
{
NSPasteboard *pb = [NSPasteboard generalPasteboard];
[pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:NSApp];
[pb setString:string forType:NSStringPboardType];
[pb stringForType:NSStringPboardType];
}