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
/* | |
Copyright (c) 2009 Remy Demarest | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following |
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
/* | |
in the place where you init the navigationController: | |
fixer = [[AENavigationControllerDelegate alloc] init]; | |
navigationController.delegate = fixer; | |
*/ | |
@interface AENavigationControllerDelegate : NSObject <UINavigationControllerDelegate> |
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
/* | |
iOS5 UIViewControllers introduced API changes with the parentViewController. | |
I'm not 100% clear why this needs to be break existing code: | |
calling parentViewController the second time on a UINavigationController returns nil. | |
For instance to insert controllers to a bottom navigationtion stack. | |
So instead simply call presentingViewController to get the bottom UINavigationController. | |
*/ | |
if ([self respondsToSelector:@selector(presentingViewController)]) | |
{ |
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
@implementation UIImage (AmosAddtions) | |
+(UIImage*) imageWithFirstRowOfImageNamed:(NSString*)imageName | |
{ | |
UIImage* firstImage = [UIImage imageNamed:imageName]; | |
UIImage* newImage = nil; | |
if (firstImage) | |
{ | |
UIGraphicsBeginImageContext(CGSizeMake(1, firstImage.size.height)); | |
[firstImage drawAtPoint:CGPointMake(0, 0)]; | |
newImage = UIGraphicsGetImageFromCurrentImageContext(); |
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 | |
public protocol KeyValueIdentifier | |
{ | |
associatedtype ValueType | |
var key : String { get } | |
} | |
public struct ValueIdentifier <T> : KeyValueIdentifier | |
{ |
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
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
if target.name == 'Mixpanel' | |
target.build_configurations.each do |config| | |
puts " Pods-Mixpanel #{config.name} before: #{config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'].inspect}" | |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)'] | |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'DISABLE_MIXPANEL_AB_DESIGNER=1' | |
puts " Pods-Mixpanel #{config.name} after: #{config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'].inspect}" | |
end | |
end |
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
extension Array { | |
func toDictioary<K: Hashable, V>(transform: @escaping (_ element:Element) -> (key: K, value: V)? ) -> [K : V] { | |
var result : [K : V] = [:] | |
forEach { | |
if let (key, value) = transform($0) { | |
result[key] = value | |
} | |
} | |
return result | |
} |
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
Scanning folders for symlinks in react-native-fiber-1.0.0/node_modules (14ms) | |
15:29:33: Starting packager... | |
***ERROR STARTING PACKAGER*** | |
Warning: You are using npm version 5.5.1. There may be bugs in this version, use it at your own risk. We recommend version 4.6.1. | |
Starting React Native packager... | |
Scanning folders for symlinks in react-native-fiber-1.0.0/node_modules (55ms) | |
Loading dependency graph. | |
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
const { writeFile } = require('fs') | |
const fetchUsers = () => | |
new Promise(r => { | |
setTimeout(() => { | |
r([ | |
{ | |
name: "amos", | |
id: "amos" | |
}, |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
OlderNewer