Skip to content

Instantly share code, notes, and snippets.

View eMdOS's full-sized avatar

Emilio Ojeda eMdOS

  • Zapopan, Jalisco
View GitHub Profile
@eMdOS
eMdOS / app.md
Created March 12, 2019 16:34
Installing .app in iPhone simulator

Installing .app in iPhone simulator

xcrun simctl install booted #{.app-path}

// Swift 3
extension DateFormatter {
public static var iso8601: DateFormatter {
return DateFormatter.iso8601DateFormatter
}
private static let iso8601DateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.locale = Locale(identifier: "en_US_POSIX")
@eMdOS
eMdOS / gist:a5fa54a0e8be32dcd6b46b83824228e6
Created February 21, 2019 03:22 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings
1. Install oh my zsh
http://ohmyz.sh/
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
1. Install powerline fonts
https://github.com/powerline/fonts
1. download agnoster theme
https://github.com/mbadolato/iTerm2-Color-Schemes/zipball/master
@eMdOS
eMdOS / ScrollableStackView.swift
Last active November 24, 2024 02:13
Scrollable Stack View
import UIKit
public class ScrollableStackView: UIView {
// MARK: Properties
private var didSetupConstraints = false
private lazy var scrollView: UIScrollView = {
let scrollView = UIScrollView(frame: .zero)
@eMdOS
eMdOS / Size Classes.md
Created November 10, 2018 03:20
Size Classes

Size Classes

(w, h)

iPad Pro 12.9"

Orientation Full Screen Split View 2/3 Split View 1/2 Split View 1/3
Portrait R, R C, R - C, R
@eMdOS
eMdOS / NibNameableView.swift
Created November 1, 2018 14:21
Table/Collection Views - Generic Cell Registration & Dequeuing
import UIKit
public protocol NibNameableView: class {
static var nibName: String { get }
}
extension NibNameableView where Self: UIView {
public static var nibName: String {
return String(describing: self)
}
@eMdOS
eMdOS / ResultType.swift
Created October 31, 2018 18:59
ResultType
import Foundation
public enum ResultType<Value> {
case success(Value)
case failure(Swift.Error)
}
extension ResultType {
public init(value: () throws -> Value) {
do {
@eMdOS
eMdOS / CGSize.swift
Created July 30, 2018 19:32
CGSize Scaling
extension CGSize {
func widthScaling(with value: CGFloat) -> CGSize {
return CGSize(width: value, height: (value * height) / width)
}
func heightScaling(with value: CGFloat) -> CGSize {
return CGSize(width: (value * width) / height, height: value)
}
}
@eMdOS
eMdOS / DOC.md
Last active July 18, 2018 21:02
Localization (Protocol-Oriented Programming approach)

Examples

  1. Getting the signInButton value from Common.strings file.
Strings.Common.signInButton.localized
@eMdOS
eMdOS / README.md
Created February 6, 2018 20:41
macOS Dock - Most recent apps
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
killall Dock