Skip to content

Instantly share code, notes, and snippets.


Rita popcornomnom

View GitHub Profile
kboy-silvergym / SnapLikePageViewController.swift
Last active Nov 14, 2019
Snapchat like PageViewController which is changing its alpha of background color as scrolling.
View SnapLikePageViewController.swift
import UIKit
enum TutorialNumber {
case first
case second
protocol TutorialVC: class {
var number: TutorialNumber { get set }
View OptionalChaining.swift
let a: Double? = 1.0
let b: Double? = 2.0
let c: Double? = 3.0
let d: Double? = 4.0
let e: Double? = 5.0
let f: Double? = 6.0
let g: Double? = 7.0
extension Optional {
func `or`(_ value : Wrapped?) -> Optional {
laurilehmijoki / keyboardHeightObservable.swift
Last active Apr 5, 2021
RxSwift Observable on iOS keyboard height
View keyboardHeightObservable.swift
import RxSwift // Version 3.2.0
import RxCocoa // Version 3.2.0
func keyboardHeight() -> Observable<CGFloat> {
return Observable
.map { notification -> CGFloat in
(notification.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.height ?? 0
wojteklu /
Last active Apr 21, 2021
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

Fluidbyte / Common-Currency.json
Last active Apr 15, 2021
Common Currency Codes in JSON
View Common-Currency.json
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"