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
class BundleSegue: ConfigurationSegue { | |
typealias Source = BundlesViewController | |
typealias Destination = BundleViewController | |
typealias First = BundlesViewController | |
typealias Second = BundleViewController | |
override func inject() { | |
destinationController.viewModel = resolver.resolve(BundleViewModelType.self) |
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
/* | |
Setting translucent to YES on the navigation bar does the trick, due to a behavior discussed in the UINavigationBar documentation. I'll report here the relevant fragment: | |
If you set this property to YES on a navigation bar with an opaque custom background image, the navigation bar will apply a system opacity less than 1.0 to the image. | |
*/ | |
// Transparent UINavigationBar | |
[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; | |
self.navigationBar.shadowImage = [UIImage new]; | |
self.navigationBar.translucent = YES; |
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
@interface UIImage (Orientation) | |
- (UIImage*)imageByNormalizingOrientation; | |
@end | |
@implementation UIImage (Orientation) | |
- (UIImage*)imageByNormalizingOrientation { |
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
import Foundation | |
import CocoaLumberjack | |
import Crashlytics | |
class CrashlyticsLogger : DDAbstractLogger | |
{ | |
static let sharedInstance = CrashlyticsLogger() | |
private var _logFormatter : DDLogFormatter? | |
override var logFormatter: DDLogFormatter? { |
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
#!/usr/bin/env python | |
import lldb | |
def slack(debugger, command, result, internal_dict): | |
frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() | |
path = command | |
lldb.debugger.HandleCommand(""" | |
expr -l swift -- |
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/sh | |
# Run this inside the project to replace NSLocalizedString calls with swiftgen calls in all .swift files. | |
# Do not forget to make a backup before. | |
find . -type f | grep ".swift" > swiftindex.temp | |
while IFS= read -r filename | |
do | |
grep -o "NSLocalizedString(\"[^\")]*\", comment:\s*\"\")" "$filename" > strings.temp |
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
// | |
// Signal+Extensions.swift | |
// Khan Academy | |
// | |
// Created by Nacho Soto on 10/1/15. | |
// Copyright © 2015 Khan Academy. All rights reserved. | |
// | |
import ReactiveCocoa |
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
#!/usr/bin/env bash | |
# Automatically installs swiftenv and run's swiftenv install. | |
# This script was designed for usage in CI systems. | |
git clone --depth 1 https://github.com/kylef/swiftenv.git ~/.swiftenv | |
export SWIFTENV_ROOT="$HOME/.swiftenv" | |
export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH" | |
if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then | |
swiftenv install -s |
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/sh | |
# settings ========== | |
# src file name | |
fileNamePrefix="ScreenShotFileNameFor5.5inch" | |
offsetFor3_5=20 | |
# dest directory name |
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
[merge] | |
keepBackup = false | |
tool = p4merge | |
[mergetool "p4merge"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\"" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false | |
[diff] | |
tool = p4merge |
OlderNewer