Skip to content

Instantly share code, notes, and snippets.

View abadikaka's full-sized avatar
🎯
Focusing

Michael Abadi Santoso abadikaka

🎯
Focusing
View GitHub Profile
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 6, 2024 13:00
crack activate Office on mac with license file
@BohdanOrlov
BohdanOrlov / ViewControllerLifecycleBehavior.swift
Created October 23, 2017 09:36
Swift implementation of idea that manny view controller can do light work: http://khanlou.com/2016/02/many-controllers/
public protocol ViewControllerLifecycleBehavior {
func afterLoading(_ viewController: UIViewController)
func beforeAppearing(_ viewController: UIViewController)
func afterAppearing(_ viewController: UIViewController)
func beforeDisappearing(_ viewController: UIViewController)
func afterDisappearing(_ viewController: UIViewController)
@codediodeio
codediodeio / database.rules.json
Last active January 28, 2024 19:07
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@stinger
stinger / Swift3GCDURLSessionDataTask.swift
Last active March 26, 2018 21:36
Swift 3: GCD and URLSessionDataTask with a completionHandler
//: # Swift 3: CGD and URLSessionDataTask
import Foundation
import PlaygroundSupport
//: ### Create background queue
let queue = DispatchQueue.global(qos: .background)
//: ### Computed variable
var time:DispatchTime! {
@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 13:07
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@esamattis
esamattis / WebViewAutoHeight.js
Last active February 11, 2022 16:01
React native: Is it possible to have the height of a html content in a webview? http://stackoverflow.com/q/32952270
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Esa-Matti Suuronen <esa-matti@suuronen.org>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@hollance
hollance / Explanation.md
Last active September 25, 2017 03:35
Communicate between objects using channels

Communicate between objects using channels

When you have two objects A and B, say two view controllers, that you want to have talk to each other, you can choose from the following options:

  • NSNotificationCenter. This is anonymous one-to-many communication. Object A posts a notification to the NSNotificationCenter, which then distributes it to any other objects listening for that notification, including Object B. A and B do not have to know anything about each other, so this is a very loose coupling. Maybe a little too loose...

  • KVO (Key-Value Observing). One object observes the properties of another. This is a very tight coupling, because Object B is now peeking directly into Object A. The advantage of KVO is that Object A doesn't have to be aware of this at all, and therefore does not need to send out any notifications -- the KVO mechanism takes care of this behind the scenes.

  • Direct pointers. Object A has a pointer to Object B and directly sends it messages when something of interest h