This file contains hidden or 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/Foundation.h> | |
@interface Parent : NSObject | |
@end | |
@implementation Parent | |
- (id)init; | |
{ | |
if (!(self = [super init])) | |
return nil; |
This file contains hidden or 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/Foundation.h> | |
@interface NSString (Reversing) | |
- (NSString *)reverseString; | |
@end | |
@implementation NSString (Reversing) | |
- (NSString *)reverseString; | |
{ | |
NSMutableString *reversedString = [NSMutableString stringWithCapacity:[self length]]; |
This file contains hidden or 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
str = "noël" # decomposed | |
puts str.reverse # expect lëon | |
puts str[0..2] # expect noë | |
puts str.length # expect 4 | |
str = "😸😾" # emoji | |
puts str.reverse # expect 😾😸 | |
puts str[1..str.length] # expect 😾 | |
puts str.length # expect 2 |
This file contains hidden or 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
package main | |
import ( | |
"time" | |
) | |
func IntRangeGenerator(min, max int) <-chan int { | |
output := make(chan int) | |
go func() { | |
for i := min; i < max; i++ { |
This file contains hidden or 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 Tim Ekl 2014–2016. Available under MIT License. | |
#import <UIKit/UIKit.h> | |
@interface UIImage (NFExtensions) | |
- (UIImage *)scaledImageConstrainedToSize:(CGSize)size; | |
@end |
OlderNewer