Skip to content

Instantly share code, notes, and snippets.

@rentzsch
rentzsch / generateFileWithRandomData.c
Created November 11, 2011 16:38
SSD Dedup Torture Test
#include <stdio.h>
#include <assert.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <openssl/rand.h>
#include <stdint.h>
#include <errno.h>
#include <sys/time.h>
11/8/11 6:41:52 PM /Users/wolf/Applications/EyeTV.app/Contents/MacOS/EyeTV[8158] BUG in libdispatch: 10K549 - 1986 - 0x4
11/8/11 10:55:00 PM /Users/wolf/Applications/EyeTV.app/Contents/MacOS/EyeTV[11861] BUG in libdispatch: 10K549 - 1986 - 0x4
11/8/11 10:57:15 PM [0x0-0xe6ae6a].com.elgato.eyetv[11861] [22:55:00.5414 | ECMicroStackChain | virtual void ECMicroStackChain::Unblock()]: Failed to unblock!
11/8/11 10:57:25 PM /Users/wolf/Applications/EyeTV.app/Contents/MacOS/EyeTV[11879] BUG in libdispatch: 10K549 - 1986 - 0x4
11/8/11 10:58:04 PM EyeTV[11879] kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 17064
11/8/11 10:58:04 PM EyeTV[11879] kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
11/8/11 10:58:04 PM EyeTV[11879] kCGErrorIllegalArgument: CGSGetWindowTags: Invalid window 0x42a8
11/8/11 10:58:04 PM [0x0-0xe6be6b].com.elgato.eyetv[11879] Tue Nov 8 22:58:04 wolf-mbp.local EyeTV[11879] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 17064
11/8/11 10:5
#import <Foundation/Foundation.h>
@interface TestableUserDefaults : NSObject {
NSString *storage;
}
@property (retain) NSString *storage;
+ (id)defaults;
- (NSArray *)arrayForKey:(NSString *)defaultName;
@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
@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];
}
}
@implementation NSScreenMainScreenSpikeAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(pollScreen:)
userInfo:nil
repeats:YES];
}
@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.

@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 / 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 / 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