Skip to content

Instantly share code, notes, and snippets.

View gugell's full-sized avatar

Ilia gugell

  • Genetec
  • Moldova, Chisinau
View GitHub Profile
@gugell
gugell / json.swift
Created October 22, 2018 10:06 — forked from chriseidhof/json.swift
Reflection
import Cocoa
struct Person {
var name: String = "John"
var age: Int = 50
var dutch: Bool = false
var address: Address? = Address(street: "Market St.")
}
struct Address {
@gugell
gugell / file0.txt
Created October 20, 2018 14:41 — forked from syou007/file0.txt
[2017年版]RxSwift + Alamofire + ObjectMapper + RealmのSwift実装について ref: http://qiita.com/syou007/items/8f27e7f0d03b9cfcff6c
github "ReactiveX/RxSwift"
github "realm/realm-cocoa"
github "Alamofire/Alamofire" ~> 4.4
github "Alamofire/AlamofireImage" ~> 3.1
github "Hearst-DD/ObjectMapper" ~> 2.2
github "tristanhimmelman/AlamofireObjectMapper" ~> 4.0

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@gugell
gugell / ObjectMapper operator for Realm.md
Created May 10, 2018 09:09 — forked from danilValeev/ObjectMapper operator for Realm.md
Easy mapping Realm's List and RealmOptional with ObjectMapper

This code helps using ObjectMapper with RealmSwift.

RealmSwift uses List<T> collection for "to many" relashionships and RealmOptional<T> for optional primitive types, but ObjectMapper can't map directly to List<T> and RealmOptional<T>.

With this operators you can properly define RealmSwift's relashionships and optional properties and use <- operator to map them.

Example

import Foundation
@gugell
gugell / задача-сайт-testhub.md
Created September 18, 2017 19:43 — forked from codedokode/задача-сайт-testhub.md
Сайт для тестирования TestHub

Задача

Примечание: раньше тут были другие условия задачи. Их можно найти в предыдущих ревизиях этого задания по ссылке https://gist.github.com/codedokode/8733007/e8e73b0255b3d899cb4e17dc9446fe694a8f5f7c

Cделать сайт TestHub, который позволяет создавать и проходить тесты. Их могут использовать например, преподаватели для проверки знаний студентов, работодатели для отсеивания кандидатов на вакансию, маркетологи для проведения опросов.

  • Предлагаемые технологии: фреймворк (Symfony 2 (сложнее, но интереснее) или Yii2), MySQL, шаблонизатор Twig, ORM Doctrine
  • Время выполнения: все зависит от тебя, но я бы смотрел на 4-6 недель
  • Уровень: продвинутый новичок
  • Требуемые знания: PHP, ООП, HTML/CSS, SQL, основы JS
#Thu Aug 01 22:59:15 EEST 2013