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
#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 / 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;
- (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);
#!/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.
# -*- coding: UTF-8 -*-
# Copyright 2009 Dirk Holtwick
# http://www.holtwick.it
VERSION = '1'
import logging
from waveapi import events
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
#!/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
/*
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];