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
typedef void (^SGBlock)(); | |
@interface NSTimer (Blocks) | |
+ (id)scheduledTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)shouldRepeat block:(SGBlock)block; | |
+ (id)timerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)shouldRepeat block:(SGBlock)block; | |
@end | |
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
// Add to (or create) ~/Library/KeyBindings/DefaultKeyBinding.dict | |
// Incorporated change by Lri to not require additional words on the line to work | |
// fixed to handle first character of list item being non-alphanumeric | |
// Issues: | |
// If there are more than one symbols ([[, ![, etc.) at the beginning of the line, anything beyond the first one is captured and added to new line | |
// FIXED: Entering more than one blank item in a row and then using ⌘Z leaves a placeholder character on the previous line. | |
{ |
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
# Create your very own Kim Jong Il funeral magic! | |
# Requires ImageMagick. | |
# OS X: brew install imagemagick | |
# Ubuntu: sudo apt-get install imagemagick | |
# | |
# Background image from Dustin Fenstermacher via http://gawker.com/5871682/give-yourself-a-dictators-funeral-with-this-kim-jong+il-photoshop-template | |
abort 'usage: jongify.rb image_file' unless ARGV.size == 1 | |
original_image = ARGV[0] |
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
@implementation NSIndexPath (JRAdditions) | |
- (NSIndexPath *) indexPathByAddingRows:(NSInteger)rows andSections:(NSInteger)sections { | |
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:MIN(NSIntegerMax, [self row] + rows) | |
inSection:MIN(NSIntegerMax, [self section] + sections)]; | |
return newIndexPath; | |
} | |
- (NSIndexPath *) indexPathByAddingRows:(NSInteger) rows { | |
return [self indexPathByAddingRows:rows andSections:0]; |
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
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
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
typedef enum { | |
kAccomplishmentTitleSection = 0, | |
kAccomplishmentCategorySection, | |
kNumberOfSections | |
} NESTemplateEditTableSections; | |
static NSString * const kCellIdentifiers[] = { | |
[kAccomplishmentTitleSection] = @"AccomplishmentTitleCell", | |
[kAccomplishmentCategorySection] = @"AccomplishmentCategoryCell" | |
}; |
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
macappstores://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/redeemLandingPage?code=XXXXXXXXX |
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 A: NSObject | |
@end | |
@implementation A | |
void pileOfPoo(id self, SEL _cmd) { | |
NSLog(@"💩"); | |
} |
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 <Kiwi/KWMatcher.h> | |
typedef NSInteger (^KWChangeMatcherCountBlock_t)(); | |
@interface KWChangeMatcher : KWMatcher { | |
@private | |
BOOL anyChange; | |
NSInteger expectedDifference, expectedTotal, actualTotal; | |
KWChangeMatcherCountBlock_t countBlock; | |
} |
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
class Prawndown | |
constructor: (@text) -> | |
toPrawn: -> | |
@text. | |
replace(/\n/g, "<br>\n"). | |
replace(/^# (.+)/gm, "<b>$1</b>") | |
# Use: | |
console.log (new Prawndown("# Foo\nbar")).toPrawn() |