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 ruby -w | |
def map(l,&f) | |
return [] if l.empty? | |
return [ f.call(l.first) ].concat map(l.slice(1..l.length), &f) | |
end | |
puts map [1,2,3,4] {|x| x+1} | |
puts map ['a','b','c','d'] {|x| "#{x} is a letter"} |
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
// NSArray+BlocksInit.h | |
- (id) initWithCount:(NSUInteger)count block:(id(^)(NSUInteger index))block | |
{ | |
NSMutableArray *array = [[NSMutableArray alloc] init]; | |
for ( NSUInteger i = 0; i < count; i++ ) { | |
id element = block(i); | |
if (element) [array addObject:element]; | |
} | |
return [array copy]; |
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 <CoreLocation/CoreLocation.h> | |
#import <ImageIO/ImageIO.h> | |
@interface CLLocation (EXIFGPS) | |
- (NSDictionary*) EXIFMetadataWithHeading:(CLHeading*)heading; | |
@end | |
@interface NSDate (EXIFGPS) |
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 <UIKit/UIKit.h> | |
@interface UIImage (SDWebImageAnimatedGifSwizzle) | |
@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
# Using tf.estimator without keras | |
session_config = tf.ConfigProto() | |
session_config.gpu_options.allow_growth=True | |
run_config = tf.estimator.RunConfig(session_config=session_config) | |
classifier = tf.estimator.Estimator(model_fn=..., config=run_config) | |
# Using any keras | |
session_config = tf.ConfigProto() |
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
[alias] | |
a = add | |
b = branch | |
c = commit | |
d = diff | |
f = fetch | |
g = grep | |
l = log | |
m = merge | |
o = checkout |