A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
:+1: | |
:-1: | |
:airplane: | |
:art: | |
:bear: | |
:beer: | |
:bike: | |
:bomb: | |
:book: | |
:bulb: |
find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done |
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
#import <UIKit/UIKit.h> | |
@interface UIView (SMFrameAdditions) | |
@property (nonatomic, assign) CGPoint $origin; | |
@property (nonatomic, assign) CGSize $size; | |
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties | |
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect | |
@end |
// | |
// UIImage+Retina4.h | |
// StunOMatic | |
// | |
// Created by Benjamin Stahlhood on 9/12/12. | |
// Copyright (c) 2012 DS Media Labs. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
#import <UIKit/UIKit.h> | |
#import <ImageIO/ImageIO.h> | |
#import <MobileCoreServices/MobileCoreServices.h> | |
static UIImage *frameImage(CGSize size, CGFloat radians) { | |
UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
[[UIColor whiteColor] setFill]; | |
UIRectFill(CGRectInfinite); | |
CGContextRef gc = UIGraphicsGetCurrentContext(); | |
CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |
@interface SomeViewController () | |
// Declare some collection properties to hold the various updates we might get from the NSFetchedResultsControllerDelegate | |
@property (nonatomic, strong) NSMutableIndexSet *deletedSectionIndexes; | |
@property (nonatomic, strong) NSMutableIndexSet *insertedSectionIndexes; | |
@property (nonatomic, strong) NSMutableArray *deletedRowIndexPaths; | |
@property (nonatomic, strong) NSMutableArray *insertedRowIndexPaths; | |
@property (nonatomic, strong) NSMutableArray *updatedRowIndexPaths; | |
@end |
// Check name validity | |
RACSignal *nameValid = [RACAbleWithStart(self.name) map:^(NSString *name) { | |
return @(name.length > 0); | |
}]; | |
RACSignal *nameValidationMessage = [nameValid map:^ id (NSNumber *valid) { | |
return valid.boolValue ? nil : @"Please enter a name that matches our bullshit rules"; | |
}]; | |
// Check email validity |
// Taken from http://PSPDFKit.com. This snippet is under public domain. | |
#define UIKitVersionNumber_iOS_7_0 0xB57 | |
BOOL PSPDFIsUIKitFlatMode(void) { | |
static BOOL isUIKitFlatMode = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
} |