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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Second Page</title> | |
</head> | |
<body> | |
<h1>This is the second page</h1> | |
<script> |
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
defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES |
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 that helps to find the week's previous/next weekday. | |
e.g. if it's sunday, what was last monday's date? | |
usage: Date().get(direction: .previous, dayName: .monday, considerToday: true) | |
*/ | |
extension Date { | |
// weekday is in form 1...7 | |
enum WeekDay: Int { | |
case sunday = 1, monday, tuesday, wednesday, thursday, friday, saturday |
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 UIKit | |
import RxCocoa | |
import RxSwift | |
// KEYBOARD STUFF | |
extension UIViewController { | |
func setupViewResizerOnKeyboardShown(bag:DisposeBag) { | |
NotificationCenter.default.rx |
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 UIKit | |
public extension String { | |
static let htmlBase = "<html><head><style type='text/css'> body { color: %COLOR%; } %STYLE% </style></head><body>%BODY%</body></html>" | |
static let cssBase = " h1 { font-family: 'GTWalsheimLight'; font-size: 34px; } h2 { font-family: 'GTWalsheimBold'; font-size: 24px; } h3 { font-family:'GTWalsheimLight'; font-size: 18px; } h4 { font-family:'GTWalsheimBold'; font-size: 14px; } h5 { font-family:'GTWalsheimBold'; font-size: 12px; } p { font-family: 'SourceSansPro-Regular'; font-size: 16px; } p.strong { font-family: 'SourceSansPro-Semibold'; font-size: 16px; }" | |
public func HTMLtoAttributedText(_ color:UIColor = UIColor.black, css:String = String.cssBase) -> NSAttributedString? { | |
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 UIKit | |
/// Load Fonts | |
/// | |
/// Example Usage: | |
/// | |
/// let fonts = ["SourceSansPro-Regular.otf", "GT-Walsheim-Regular.ttf"] | |
/// | |
/// let loadedSuccessfuly = loadFonts(fonts) | |
/// |
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
// Inspired by: https://gist.github.com/futurepaul/8b99d502006cf8a67a93 | |
import UIKit | |
typealias 🐾 = String | |
let 🌍 = "🦃🕊🐶🐺🐱🐭🐹🐰🐸🐯🐨🐻🐷🐽🐮🐗🐵🐒🐴🐑🐘🐼🐧🐦🐤🐥🐣🐔🐍🐢🐛🐝🐜🐞🐌🐙🐚🐠🐟🐬🐳🐋🐄🐏🐀🐃🐅🐇🐉🐎🐐🐓🐕🐖🐁🐂🐲🐡🐊🐫🐪🐆🐈🐩" | |
let 🚢 = 🌍.characters | |
.map { (🚜) -> 🐾 in | |
return 🐾(🚜) | |
} |
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
➜ Maven git:(master) ✗ ping -c google.com | |
ping: invalid count of packets to transmit: `google.com' | |
➜ Maven git:(master) ✗ ping -c 10 google.com | |
PING google.com (74.125.226.9): 56 data bytes | |
64 bytes from 74.125.226.9: icmp_seq=0 ttl=52 time=13.532 ms | |
64 bytes from 74.125.226.9: icmp_seq=1 ttl=52 time=562.196 ms | |
64 bytes from 74.125.226.9: icmp_seq=2 ttl=52 time=11.785 ms | |
64 bytes from 74.125.226.9: icmp_seq=3 ttl=52 time=18.157 ms | |
64 bytes from 74.125.226.9: icmp_seq=4 ttl=52 time=12.873 ms | |
64 bytes from 74.125.226.9: icmp_seq=5 ttl=52 time=10.785 ms |
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
let state = [ "AK - Alaska", | |
"AL - Alabama", | |
"AR - Arkansas", | |
"AS - American Samoa", | |
"AZ - Arizona", | |
"CA - California", | |
"CO - Colorado", | |
"CT - Connecticut", | |
"DC - District of Columbia", | |
"DE - Delaware", |
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 JGCell : UITableViewCell { | |
override init(style: UITableViewCellStyle, reuseIdentifier: String!) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) | |
setupViews() | |
} | |
required init(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) |
NewerOlder