Skip to content

Instantly share code, notes, and snippets.

View cojoj's full-sized avatar

Mateusz Zając cojoj

View GitHub Profile
@cojoj
cojoj / xmas.py
Created December 30, 2022 12:28
Christmas Tree (with ornaments, star and gifts) written in Python Turtle
import random
import turtle
def initialize_screen():
screen = turtle.Screen()
screen.title = "Xmas Tree by Tomasz Kita"
screen.bgcolor("sky blue")
screen.colormode(255)
@cojoj
cojoj / testArchitecture.swift
Last active January 10, 2019 11:56
This is a test MVVHP architecture. It's just a proof of concept.
import UIKit
// We need a definition of a Presenter.
// It'll have associated type for handler, propety of this type and a possibility to
// bind a View Handler.
protocol Presenter {
associatedtype ViewHandler: BaseViewHandler
var viewHandler: ViewHandler? { get set }
mutating func bind(handler: ViewHandler)
}
// This gist is to show you how I was able to _finally_ marry MVVM-C with Storyboards.
// There are quite some tutorials on this architecture, but majority of devs choose Xibs instaed of Storyboards.
// I get their point, but... Xibs to me feel like 1984 😜
//
// I started working on this new app, and I've decided to go with coordinators + MVVM as it's seems like a fair
// compromise between modularity, extendability and simplicity, so I started laying out everything in code + Storyboards.
// I've done it before, so I knew that Storyboards in this case will serve as a **containers** for app modules like:
// + Main
// + Auth
// + Camera
func configureBasicStuff() {
doSomeMagic()
networkingManager = SuperDuperNetworking.sharedInstance()
for constraint in textConstraints {
constraints.append(LayoutConstraint(constraint))
}
label.text = "This is wrong!".uppercaseString
label.font = UIFont(name: "CirceBold", size: 11)
func viewDidLoad() -> Void {
super.viewDidLoad()
configureBasicStuff() -> Void
prepareSomeFood() -> Void
if production {
configureSomeFancyProperties() -> Void
} else {
showMeSomeMemes() -> Void
@cojoj
cojoj / 1.swift
Last active April 15, 2017 20:24
func viewDidLoad() {
super.viewDidLoad()
configureBasicStuff()
prepareSomeFood()
if production {
configureSomeFancyProperties()
} else {
showMeSomeMemes()
@cojoj
cojoj / list.md
Last active November 19, 2020 08:04
Number of people working on iOS apps

Purpose of this list is to gather a source of information on how many people are working on iOS application.
I often wonder how many people are behind Facebook's app or Twitter's. If you're as curious as me, please share and please add apps 😉.

* - it's a rumoured value only. Needs confirmation from someone inside the company.

  1. Fishbrain - 3
  2. Artsy - 5
  3. Truecaller - 5
  4. Lifesum - 4 or 5
  5. Spotify - 50*
@cojoj
cojoj / cloudSettings
Created December 5, 2016 11:40 — forked from orta/cloudSettings
Visual Studio code settings
{"lastUpload":"2016-12-05T11:30:54.693Z"}
@cojoj
cojoj / beer.md
Last active October 1, 2015 14:30
MobiConf iOS beer-time

Ok, if you're in Cracow for the #MobiConf2015 and if you want to try some fine beers insted of regular ones like Żywiec or Tyskie (which are fine BTW) you shoud visit something from the list (or maybe do a BAR CRAWL):

  • Let's start with House of Beer. I really enjoy this one as they have a lot of manufactured beers from small breweries all over the 🇵🇱.
  • There's also this cool place near the Main square called Tap House.
  • If you're really in need of something brewed in-house go to CK Browar.
  • You may be near Kazimierz, if so, go to Strefa Piwa or Omerta (Yeah, I know they've pretty cool website 😂).
  • Of course, you can be somewhere near the ICE and there's also something for you and it's called TEA Time.
  • Maybe your're just a Irishy-styled guy and you love a nice pint of Guinnes... [Irish Pub](http://www.podpapug
func readSample(sampleType: HKSampleType, predicate: NSPredicate?, limit: Int?, completion: ((results: [HKSample]?, error: ErrorType?) -> Void)!) {
// Read stored anchor (If this is the first run 0 will be returned which is equal to HKAnchoredObjectQueryNoAnchor)
let anchorValue = defaults.integerForKey(sampleType.identifier)
let limit = limit ?? Int(HKObjectQueryNoLimit)
let query = HKAnchoredObjectQuery(type: sampleType, predicate: predicate, anchor: anchorValue, limit: limit) { (query, results, newAnchor, error) -> Void in
guard let results = results where error == nil else {
completion(results: nil, error: error)
return
}