Skip to content

Instantly share code, notes, and snippets.

View holtwick's full-sized avatar
👁️‍🗨️
On a mission for privacy

Dirk Holtwick holtwick

👁️‍🗨️
On a mission for privacy
View GitHub Profile
/*
I wonder if a code analyzer would be able to find such a selector... ;)
Kids, don't try that at home!
*/
char *translatePrivateSelectorName(char *buffer, char *sel) {
int pos = 0;
for (int i = 0; i < strlen(sel); i++) {
if(sel[i] != '/') {
buffer[pos++] = sel[i];
#!/usr/bin/env python2.4
# Needs python 2.6 - for 2.5 replace ssl and json (with simplejson)
print "Content-Type: text/plain"
print
import socket, ssl, struct
# import simplejson as json
import cgi
Definition of API:
http://en.wikipedia.org/wiki/Application_programming_interface
---
Source for iPhone URL Schemes:
http://handleopenurl.com/
Web API Listing:
http://www.programmableweb.com/apis/directory/1?sort=date
# -*- coding: UTF-8 -*-
# Copyright 2009 Dirk Holtwick
# http://www.holtwick.it
VERSION = '1'
import logging
from waveapi import events
#!/usr/bin/env python2.6
"""IMAP Incremental Backup Script"""
__version__ = "1.4a"
__author__ = "Rui Carmo (http://the.taoofmac.com)"
__copyright__ = "(C) 2006 Rui Carmo. Code under BSD License.\n(C)"
__contributors__ = "Bob Ippolito, Michael Leonhard, Giuseppe Scrivano <gscrivano@gnu.org>"
# = Contributors =
# Giuseppe Scrivano: Added support for folders.
- (void)test:(id)some second:(id)sec {
// Inspired by http://stackoverflow.com/questions/1797964/how-to-pass-all-arguments-of-a-method-into-nslog/1799472#1799472
{
// Find argument stack and skip first arguments
void *stack = &self;
stack += sizeof(self);
stack += sizeof(_cmd);
@holtwick
holtwick / asmacro.m
Created October 29, 2010 07:54
Log current method and the arguments passed to that method
#if DEBUG
#import <objc/runtime.h>
#import <objc/message.h>
#include <execinfo.h>
#include <stdio.h>
void dumpCall(id *__selfPtr, SEL __cmd) {
// Get argument stack
id __self = *__selfPtr;
#if DEBUG
#import <objc/runtime.h>
#import <objc/message.h>
#include <execinfo.h>
#include <stdio.h>
void dumpCall(id *__selfPtr, SEL __cmd) {
// Get argument stack
id __self = *__selfPtr;
@holtwick
holtwick / proceedsappstore.py
Created December 7, 2010 18:18
Analyze AppStore Daily Reports
import glob
d = {}
for fn in glob.glob('appsales/*.txt'):
lines = open(fn, 'r').readlines()[1:]
# print fn
for l in lines:
l = l.split('\t')
if len(l) == 18: # only newest format
proceeds = float(l[8])
@holtwick
holtwick / SeaDataSpeedTests.m
Created February 3, 2018 20:02
Speed and size testing for JSON, MessagePack, Plist and KeyedArchiver
// (C)opyright 2018-02-03 Dirk Holtwick, holtwick.it. All rights reserved.
#import <XCTest/XCTest.h>
#import "MPMessagePack.h"
#import "NSData+GZIP.h"
@interface SeaDataSpeedTests : XCTestCase
@end