This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 $? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| # |