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 Tim Ekl 2014–2016. Available under MIT License. | |
#import <UIKit/UIKit.h> | |
@interface UIImage (NFExtensions) | |
- (UIImage *)scaledImageConstrainedToSize:(CGSize)size; | |
@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
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 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 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 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 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
on run | |
display dialog "Drag keynote documents on me to convert to PDF." | |
end run | |
on open draggeditems | |
repeat with thisFile in draggeditems as list | |
tell application "Finder" to reveal item thisFile | |
set thisFile to thisFile as alias | |
tell application "Keynote" to open thisFile |
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/Foundation.h> | |
#import <AppKit/AppKit.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
SEL *selectors = malloc(10 * sizeof(SEL)); | |
// The following selectors are taken from the NSTextAttachmentCell protocol reference. | |
// That document states that NSCell responds to all of its declared methods with three exceptions (noted below). | |
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 <stdio.h> | |
int main(int argc, char *argv[]) { | |
printf("Get things done!"); | |
return 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
plugin: | |
default_locale: en | |
locales: [en] | |
# if allow_channels is false, your users will be unable to use any channel | |
# related commands, and as such the default channel will become their permanent | |
# chat place (it is recommended to set default_channel to global if you set this to false) | |
# note: a change to this setting will require a full /reload or server restart | |
allow_channels: true | |
allow_whispers: true | |
allow_afk: 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
# Tested with Ruby 1.9 | |
# Needs gem "guard" (https://github.com/guard/guard) | |
# Needs gem "guard-shell" (https://github.com/guard/guard-shell) | |
# Uses process "growlnotify" (http://growl.info/extras.php) | |
# Uses process "pdflatex" from standard TeXLive distribution | |
guard 'shell' do | |
watch(%r{(.+)\.tex}) do |m| | |
`growlnotify -m #{m[0]} Recompiling` | |
`pdflatex -interaction=batchmode #{m[0]} >/dev/null` |
NewerOlder