Skip to content

Instantly share code, notes, and snippets.

View pawelmilek's full-sized avatar

Pawel Milek pawelmilek

View GitHub Profile
@pawelmilek
pawelmilek / clean_code.md
Created November 16, 2019 23:58 — forked from wojteklu/clean_code.md
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

@pawelmilek
pawelmilek / UITableView+beginRefreshing.swift
Created June 24, 2018 23:41 — forked from mttcrsp/UITableView+beginRefreshing.swift
Extension that allows programmatic pull to refresh
import UIKit
public extension UITableView {
public func beginRefreshing() {
// Make sure that a refresh control to be shown was actually set on the view
// controller and the it is not already animating. Otherwise there's nothing
// to refresh.
guard let refreshControl = refreshControl, !refreshControl.isRefreshing else {
return
@pawelmilek
pawelmilek / LocationService.swift
Created February 5, 2016 00:55 — forked from igroomgrim/LocationService.swift
Simply Singleton CLLocationManager Class in Swift
//
// LocationService.swift
//
//
// Created by Anak Mirasing on 5/18/2558 BE.
//
//
import Foundation
import CoreLocation