Skip to content

Instantly share code, notes, and snippets.

#0 0x00007fff853eac0c in unlink ()
#1 0x00007fff853fa1ca in __removefile_process_file ()
#2 0x00007fff853f95a9 in __removefile_tree_walker ()
#3 0x00007fff853f94c3 in removefile ()
#4 0x00007fff81961bd3 in -[NSFilesystemItemRemoveOperation main] ()
#5 0x00007fff81935de4 in -[__NSOperationInternal start] ()
#6 0x00007fff81961998 in -[NSFileManager removeItemAtPath:error:] ()
#7 0x00007fff88369aee in -[NSPersistentStore(_NSInternalMethods) _unload:] ()
#8 0x00007fff8836904c in -[NSPersistentStore willRemoveFromPersistentStoreCoordinator:] ()
#9 0x00007fff88387eff in -[NSPersistentStoreCoordinator _removePersistentStore:] ()
require 'cgi'
`open 'http://www.google.com/search?q=#{CGI.escape(STDIN.read.chomp)}'`
@rentzsch
rentzsch / openssl-s_client.sh
Created June 1, 2011 00:28
openssl s_client
$ openssl s_client -connect encrypted.google.com:443 -quiet
depth=1 /C=US/O=Google Inc/CN=Google Internet Authority
verify error:num=20:unable to get local issuer certificate
verify return:0
GET / HTTP/1.0
Host: encrypted.google.com:443
HTTP/1.0 200 OK
Date: Wed, 01 Jun 2011 00:24:28 GMT
Expires: -1
@rentzsch
rentzsch / gist:1047798
Created June 26, 2011 17:50
+numberWithBool: vs +numberWithInt: in ASCII plists: FIGHT!
// JSTalk:
var a = [NSMutableDictionary dictionary];
[a setObject: [NSNumber numberWithBool:YES] forKey:@"Bool"];
[a setObject: [NSNumber numberWithInt:1] forKey:@"Number"];
[a description];
=>
{
@rentzsch
rentzsch / gist:1047967
Created June 26, 2011 20:56
Close a Chrome Tab using AppleScript
tell application "Google Chrome"
set windowList to every tab of every window whose URL starts with "https://mail.google.com"
repeat with tabList in windowList
set tabList to tabList as any
repeat with tabItr in tabList
set tabItr to tabItr as any
delete tabItr
end repeat
end repeat
end tell
@rentzsch
rentzsch / "Fixed" Post (Explicit Outline Numbering).markdown
Created July 26, 2011 17:06
MarsEdit Markdown vs Tumblr MultiMarkdown

On Aug 10 2010 I bought a 1-year SSL cert from GoDaddy (I know, I know) for $12.99. I installed it and successfully used it on an ecommerce site.

On June 25th I get an email warning me that my cert "is coming up for renewal in 15 days". June 25 + 15 days == July 10th. Sure enough, this morning GoDaddy auto-renewed my SSL cert. Which I never enabled auto-renew on. And, they raised its price to $49.99.

Pretty impressive, GoDaddy has four levels of scams going on here:

  1. The expiration date on the cert itself is Aug 12 2011. But they try to renew you about a month ahead of the expiration date, effectively shorting you a months worth of your cert's lifetime.

  2. GoDaddy enables auto-renewal by default. It's easy enough to opt out of auto-renewal for their domains, but I couldn't find a way to disable it for SSL certs. I foolishly concluded that meant it wouldn't auto-renew.

@implementation NSScreenMainScreenSpikeAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(pollScreen:)
userInfo:nil
repeats:YES];
}
@rentzsch
rentzsch / gist:1216022
Created September 14, 2011 07:14
NSString* JRNSStringFromCATransform3D(CATransform3D transform)
static NSString* prettyFloat(CGFloat f) {
if (f == 0) {
return @"0";
} else if (f == 1) {
return @"1";
} else {
return [NSString stringWithFormat:@"%.3f", f];
}
}
@rentzsch
rentzsch / gist:1241151
Created September 25, 2011 21:03
CoreData minion_duties2 crash
Process: Hibari [3761]
Path: /Applications/Hibari.app/Contents/MacOS/Hibari
Identifier: com.violasong.Hibari
Version: 1.1 (1.1)
Code Type: X86-64 (Native)
Parent Process: launchd [180]
Date/Time: 2010-09-29 20:19:08.259 -0500
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6
#import <Foundation/Foundation.h>
@interface TestableUserDefaults : NSObject {
NSString *storage;
}
@property (retain) NSString *storage;
+ (id)defaults;
- (NSArray *)arrayForKey:(NSString *)defaultName;