most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| #!/bin/bash | |
| # SPDX-License-Identifier: MIT | |
| ## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
| ## | |
| ## This script is licensed under the terms of the MIT license. | |
| ## https://opensource.org/licenses/MIT | |
| # | |
| # Lockable script boilerplate | |
| - (void)dealloc { | |
| webView_.delegate = nil; // delegate is self here, so first set to nil before call stopLoading. | |
| [webView_ stopLoading]; | |
| // UIWebView must be released in the main thread, or we get: | |
| // Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... | |
| // This is less evil than the proposed http://stackoverflow.com/questions/945082/uiwebview-in-multithread-viewcontroller | |
| // Calling removeFromSuperview in a dealloc is ugly and evil, but else UIView has a strong reference to UIWebView and our main-release call would be irrelevant. | |
| if (![NSThread isMainThread]) { | |
| [webView_ performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:YES]; |
| i386 : iPhone Simulator | |
| x86_64 : iPhone Simulator | |
| arm64 : iPhone Simulator | |
| iPhone1,1 : iPhone | |
| iPhone1,2 : iPhone 3G | |
| iPhone2,1 : iPhone 3GS | |
| iPhone3,1 : iPhone 4 | |
| iPhone3,2 : iPhone 4 GSM Rev A | |
| iPhone3,3 : iPhone 4 CDMA | |
| iPhone4,1 : iPhone 4S |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| // ...Snipped... | |
| [NSClassFromString(@"WebView") _enableRemoteInspector]; | |
| // ...Snipped... | |
| } | |
| And connect in Safari to localhost:9999 |
| + (NSString *)encodeStringWithCoordinates:(NSArray *)coordinates | |
| { | |
| NSMutableString *encodedString = [NSMutableString string]; | |
| int val = 0; | |
| int value = 0; | |
| CLLocationCoordinate2D prevCoordinate = CLLocationCoordinate2DMake(0, 0); | |
| for (NSValue *coordinateValue in coordinates) { | |
| CLLocationCoordinate2D coordinate = [coordinateValue MKCoordinateValue]; | |
| -- Found at: http://hints.macworld.com/article.php?story=2007102012424539 | |
| -- Example list of processes to ignore: {"xGestures"} or {"xGestures", "OtherApp", ...} | |
| property processesToIgnore : {"loginwindow", "talagent", "Dock", "SystemUIServer", "SIMBL Agent", "AFSBackgrounder", "NotificationCenter", "iTunesHelper", "PhotoStreamAgent", "com.apple.dock.extra", "WebProcess", "AppleSpell", "com.apple.qtkitserver", "SophosUIServer", "PTPCamera", "Image Capture Extension", "mdworker", "System Events"} | |
| -- Get the size of the Display(s), only useful if there is one display | |
| -- otherwise it will grab the total size of both displays | |
| tell application "Finder" | |
| set _b to bounds of window of desktop | |
| set screen_width to item 3 of _b |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| cd repository | |
| git checkout --orphan orphan_name | |
| git rm -rf . | |
| rm '.gitignore' | |
| echo "#Title of Readme" > README.md | |
| git add README.md | |
| git commit -a -m "Initial Commit" | |
| git push origin orphan_name |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |