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
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); | |
} | |
} |
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
// NSString_stripHtml.h | |
// Copyright 2011 Leigh McCulloch. Released under the MIT license. | |
#import <Foundation/Foundation.h> | |
@interface NSString (stripHtml) | |
- (NSString*)stripHtml; | |
@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
# 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] |
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
/* Google - Standard new analytics code. Replace the UA-XXXXXXXX-X and example.com. */ | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','http://www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-X', 'example.com'); | |
ga('send', 'pageview'); | |
/* Catch any outbound links, register them with Google Analytics. | |
Outbound links will be displayed in your analytics account as 'out/[outbound url]'. |
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
// | |
// NSData+HexString.h | |
// | |
// Copyright (c) 2013, Leigh McCulloch. All rights reserved. | |
// BSD-2-Clause License: http://opensource.org/licenses/BSD-2-Clause | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSData (HexString) |
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
@echo off | |
rem configurable parameters | |
set SCREENCAP_FILE_PREFIX=screenshot | |
rem the dir on the device where the screenshot will be stored temporarily | |
set SCREENCAP_WORKING_DIR=/sdcard/ | |
rem adb path, leave blank if adb is already on the user or system path | |
set SCREENCAP_ADB_PATH= |
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
# Multi-Region DNS NameServer Propogation Check | |
# | |
# Uses the dns-lg.com API to retrieve the NS records for a zone (domain name) | |
# at 19 (more or less) different locations globally. Use this to monitor the | |
# propogation of nameserver changes at your registrar. | |
# | |
# Note: There is no such thing as a guarantee when it comes to whether your | |
# new nameservers have propogated fully or not. Rule of thumb is three days | |
# but often it is much faster and this check can help you weigh the risks. |
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 ruby | |
require 'aws-sdk-v1' | |
print "S3 bucket name: " | |
bucket_name = STDIN.gets.chomp | |
print "AWS Access Key ID: " | |
aws_id = STDIN.gets.chomp | |
print "AWS Access Secret Key: " | |
aws_key = STDIN.gets.chomp | |
print "AWS Root MFA Serial: " |
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 ruby | |
require 'aws-sdk' | |
print "AWS Account ID: " | |
aws_account_id = STDIN.gets.chomp | |
print "S3 bucket name: " | |
bucket_name = STDIN.gets.chomp | |
print "AWS Access Key ID: " | |
aws_id = STDIN.gets.chomp | |
print "AWS Access Secret Key: " |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "0", | |
"Effect": "Allow", | |
"Action": ["s3:ListAllMyBuckets", "s3:ListObjects"], | |
"Resource": "*" | |
}, | |
{ |
OlderNewer