title | theme | revealOptions | ||
---|---|---|---|---|
SwiftLint |
solarized |
|
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
#!/usr/bin/python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2013 deanishe@deanishe.net. | |
# | |
# MIT Licence. See http://opensource.org/licenses/MIT | |
# | |
# Created on 2013-11-01 | |
# |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
extension Optional where Wrapped: OptionalString { | |
var isNilOrEmpty: Bool { | |
return ((self as? String) ?? "").isEmpty | |
} | |
} |
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
class API { | |
var status: String? | |
var failureHandler: (() -> Void)? | |
var completionHandler: (() -> Void)? | |
init() {} | |
} | |
class ViewController: UIViewController { |
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
#!/bin/bash | |
if [[ $1 = "" ]]; then | |
echo Usage: disableAppTransportSecurity.sh PLIST_PATH | |
exit 1 | |
fi | |
#PlistBuddy的位置 | |
PLISTBUDDY="/usr/libexec/PlistBuddy" |
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
- (UIImage *)snapshot { | |
int webViewHeight = [self stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight;"].floatValue; | |
CGFloat pageHeight = self.frame.size.height; | |
int pageCount = webViewHeight / pageHeight; | |
if ((webViewHeight % pageCount) > 0) { | |
pageCount++; | |
} | |
for (int i = 0; i < pageCount; 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
[[UIBarButtonItem appearance] setBackgroundImage:[UIImage new] | |
forState:UIControlStateNormal | |
barMetrics:UIBarMetricsDefault]; | |
[[UINavigationBar appearance] setTitleTextAttributes:@{ | |
NSForegroundColorAttributeName: [UIColor blackColor], | |
NSFontAttributeName: [UIFont systemFontOfSize:17], | |
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetZero] | |
}]; | |
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
#Convert your feedly OPML file to a markdown file | |
#Usage: | |
#ruby opml_to_markdown.rb FEEDLY_OPML_PATH | |
require 'nokogiri' | |
markdownContent = "" | |
opmlFile = File.open(ARGV[0]) | |
opmlDoc = Nokogiri::XML(opmlFile) | |
markdownName = opmlDoc.xpath('//head/title').text |