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
| // Find out where the frames will be with the "after" layout | |
| 1. Remove the "before" constraints | |
| 2. Add the "after" constraints | |
| 3. Call [window layoutIfNeeded], to force the frames to update | |
| 4. Grab the frames of all the views I want to animate and save them off | |
| // Go back to what the user sees | |
| 5. Remove the "after" constraints | |
| 6. Add the "before" constraints | |
| 7. Call [window layoutIfNeeded], to force the frames to update |
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
| #from http://apple.stackexchange.com/questions/35602/turn-on-bluetooth-via-terminal-command-line | |
| # This is only necessary, if AppleScripts are not yet allowed to change checkboxes | |
| tell application "System Events" to set UI elements enabled to true | |
| # Now change the bluetooth status | |
| tell application "System Preferences" | |
| set current pane to pane id "com.apple.preferences.bluetooth" | |
| tell application "System Events" | |
| tell process "System Preferences" | |
| # Enabled is checkbox number 2 | |
| if value of checkbox 2 of window "Bluetooth" is 0 then |
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
| // | |
| // NSNumber_Extensions.h | |
| // TouchCode | |
| // | |
| // Created by Jonathan Wight on 12/8/11. | |
| // Copyright (c) 2011 TouchCode. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
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
| #import "CALayer_HitTestExtensions.h" | |
| #import <objc/runtime.h> | |
| static void *kHitMask; | |
| @implementation CALayer (CALayer_HitTestExtensions) | |
| - (NSUInteger)hitMask | |
| { |
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
| tell application "Google Chrome" | |
| set vurl to get URL of active tab of first window | |
| tell application "VLC" | |
| activate | |
| OpenURL vurl | |
| fullscreen | |
| play | |
| end tell | |
| end tell |
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
| NSString *someVar = @"a String"; | |
| NSMutableString *myString = [[NSMutableString alloc] initWithFormat:@"%@ %@",someVar]; | |
| //or | |
| NSMutableString *myString = [NSMutableString stringWithFormat:@"%@ %@",someVar]; | |
| //LLVM 2.0 does not warn you that you are missing a 2nd var in the format |
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
| samurai% /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
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
| // NSURLConnection wrapper | |
| // like NSURLConnection, requires a runloop, callbacks happen in runloop that set up load | |
| @interface LDURLLoader : NSObject | |
| { | |
| NSURLConnection *_connection; | |
| NSTimeInterval _timeout; | |
| NSTimer *_timeoutTimer; | |
| NSURLResponse *_response; | |
| long long _responseLengthEstimate; | |
| NSMutableData *_accumulatedData; |
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/python | |
| import sys | |
| import os | |
| from collections import defaultdict | |
| import hashlib | |
| theRoot = '/Volumes/Stuff/Files/' | |
| theTrashFolder = '/Volumes/Stuff/Trash/' |
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
| #ifndef __clang_analyzer__ | |
| // source here | |
| #endif |