Skip to content

Instantly share code, notes, and snippets.

View zats's full-sized avatar

Sash Zats zats

View GitHub Profile
@zats
zats / Models.swift
Last active August 10, 2017 19:49 — forked from JaviSoto/SampleViewController.swift
Init based Storyboard View Controller Instantiation
import Foundation
// Some clearly non-NSObject-based models:
enum Coconut: String {
case small, medium, large
}
struct Tomato {
static var red = Tomato(color: #colorLiteral(red: 0.7490196078, green: 0.09803921569, blue: 0.02352941176, alpha: 1))
class Parent {
var child: Child? {
didSet {
child.callback = weak(self)?.delegateCallback
}
}
func delegateCallback() {
// ...
@zats
zats / 0_reuse_code.js
Created January 20, 2014 15:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zats
zats / gist:4068316
Created November 13, 2012 20:52
Updating fork from original repository
# Adding original repository as a fork
git remote add --track master forked_from git://github.com/user/repo.git
# Fetch from remote called forked_from
git fetch forked_from
# Merging codeabase
git merge forked_from/master