A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
- Headers
- Links
- Bold
| #!/bin/bash | |
| f=$(pwd) | |
| sips --resampleWidth 1024 "${f}/${1}" --out "${f}/[email protected]" | |
| sips --resampleWidth 57 "${f}/${1}" --out "${f}/app-icon.png" | |
| sips --resampleWidth 114 "${f}/${1}" --out "${f}/[email protected]" | |
| sips --resampleWidth 29 "${f}/${1}" --out "${f}/app-icon-29.png" | |
| sips --resampleWidth 58 "${f}/${1}" --out "${f}/[email protected]" |
| - (void)viewWillAppear:(BOOL)animated | |
| { | |
| [super viewWillAppear:animated]; | |
| [self.transitionCoordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { | |
| if ( [context initiallyInteractive] ) return; | |
| [self _onTransitionEnd:context]; | |
| }]; | |
| [self.transitionCoordinator notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) { | |
| [self _onTransitionEnd:context]; |
| $(window).on('load', function(e) { | |
| if (window.location.hash == '#_=_') { | |
| window.location.hash = ''; // for older browsers, leaves a # behind | |
| history.replaceState('', document.title, window.location.pathname); // nice and clean | |
| e.preventDefault(); // no page reload | |
| } | |
| }); |
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()):
| CGFloat BNRTimeBlock (void (^block)(void)); |
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
| // | |
| // UIWebView+Markdown.m | |
| // DropTextwiki | |
| // | |
| // Created by Daniel Hjort on 6/5/11. | |
| // Copyright 2011 Patchwork Solutions AB. All rights reserved. | |
| // | |
| #import "UIWebView+Markdown.h" | |
| #import "html.h" |
| // | |
| // NSAttributedString+fromHTML.m | |
| // Berlingske | |
| // | |
| // Created by Taras Kalapun on 18.08.10. | |
| // Copyright (c) 2010 Ciklum. All rights reserved. | |
| // | |
| #import "NSAttributedString+fromHTML.h" |
| // Change straight quotes to curly and double hyphens to em-dashes. | |
| function smarten(a) { | |
| a = a.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018"); // opening singles | |
| a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes | |
| a = a.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c"); // opening doubles | |
| a = a.replace(/"/g, "\u201d"); // closing doubles | |
| a = a.replace(/--/g, "\u2014"); // em-dashes | |
| return a | |
| }; |