Skip to content

Instantly share code, notes, and snippets.

# Author: Leigh McCulloch
# License: BSL-1.0 (http://www.opensource.org/licenses/BSL-1.0)
#
# This script takes arguments from the command line and autotypes
# them with tab separators into the last selected application.
# This can be used from one application to auto-type into another
# application.
#
# Command line usage:
# osascript autotype.spct [username] [password]
@leighmcculloch
leighmcculloch / NSString_stripHtml.h
Last active February 21, 2018 22:45
NSString + Strip HTML
// NSString_stripHtml.h
// Copyright 2011 Leigh McCulloch. Released under the MIT license.
#import <Foundation/Foundation.h>
@interface NSString (stripHtml)
- (NSString*)stripHtml;
@end
@leighmcculloch
leighmcculloch / file_recursive.php
Last active September 27, 2015 03:08
PHP Recursive File/Directory Functions
function recursive_delete($dir) {
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $file) {
$path = $file->__toString();
if($file->isDir()) {
rmdir($path);
} else {
unlink($path);
}
}