Skip to content

Instantly share code, notes, and snippets.

@willonboy
willonboy / absim.sh
Created February 11, 2014 02:14 — forked from 0xced/absim.sh
#!/bin/bash
cd ~/Library/Application\ Support/MobileSync/Backup
backup=`ls -t1 | sed -n '1p'` # most recent backup
for f in "$backup"/*.mdinfo; do
grep -q "Library/AddressBook/AddressBook.sqlitedb" $f
if [ $? -eq 0 ]; then
addressbook=`basename $f .mdinfo`
cp -v "`pwd`/$backup/$addressbook.mddata" ~/Library/Application\ Support/iPhone\ Simulator/User/Library/AddressBook/AddressBook.sqlitedb
exit $?
# -*- Encoding: utf-8 -*-
from M2Crypto.EVP import Cipher
key = 'a' * 16
text = 'Hello, there!'
cipher = Cipher(alg='des_ede_ecb', key=key, op=1, iv='\0'*16)
// Reads in a set of raw data files, and outputs smoothed files. (lots of libdispatch magic)
#define SIGMA (50)
- (IBAction)smoothDataSets:(id)sender {
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger ret){
if(ret == NSOKButton){
// Apply to each file and then output appropriately.
dispatch_group_t smooth_group = dispatch_group_create();
dispatch_queue_t global_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
for(NSURL *url in [openPanel URLs]){
const char *in_path = [[url path] UTF8String];
@willonboy
willonboy / hack.sh
Created April 1, 2012 05:48 — forked from cocos2d/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#