This file contains 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 | |
# put this file at the root of your workspace (next to .metadata folder) | |
rm -rf .metadata/.lock | |
rm -rf .metadata/.plugins/org.eclipse.core.resources/.snap |
This file contains 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 | |
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all -clientopts -setvnclegacy -vnclegacy -yes -setvncpw -vncpw somesecretpassword |
This file contains 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 | |
# Downsamples all retina ...@2x.png images. | |
echo "Downsampling retina images..." | |
dir=$(pwd) | |
find "$dir" -name "*@2x.png" | while read image; do | |
outfile=$(dirname "$image")/$(basename "$image" @2x.png).png |
This file contains 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
// usage : HEX(0xB5C5D2) | |
#define HEX(hex) [UIColor colorWithRed:(((hex) >> 16)&0x000000FF)/255.0 green:(((hex) >> 8)&0x000000FF)/255.0 blue:((hex)&0x000000FF)/255.0 alpha:1.0] |
This file contains 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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// show main window | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
self.home = [[HomeViewController alloc] init]; | |
UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.home]; | |
[self.window setRootViewController:nav]; | |
[self.window makeKeyAndVisible]; | |
// register for push if needed |
This file contains 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
enum State { | |
case Begin | |
case Changed | |
case End | |
} | |
let state: State = .Begin | |
switch(state) { | |
case .Begin, .Changed: |
This file contains 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
Process: rac-bug [45562] | |
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/1F33AA4E-773A-4C39-A87A-209C75361233/data/Containers/Bundle/Application/207036DA-A1D0-462A-AD1F-B5C0DC42B064/rac-bug.app/rac-bug | |
Identifier: rac-bug | |
Version: 1.0 (1) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd_sim [45276] | |
Responsible: launchd_sim [45276] | |
User ID: 501 | |
Date/Time: 2015-09-21 10:06:42.848 +0200 |
This file contains 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
let myString: String? = nil | |
protocol PossiblyEmpty { | |
var isEmpty: Bool { get } | |
} | |
extension String: PossiblyEmpty {} | |
extension Optional where Wrapped: PossiblyEmpty { | |
var isEmpty: Bool { |
This file contains 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
let myString: String? = … | |
if myString?.isEmpty ?? true { … } |
This file contains 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
let myString: String? = … | |
if myString.isEmpty { … } |
OlderNewer