Skip to content

Instantly share code, notes, and snippets.

View mikengyn's full-sized avatar

Mike Nguyen mikengyn

  • https://miken.design
  • Toronto
View GitHub Profile
@ejmartin504
ejmartin504 / StackableWebView.swift
Created March 13, 2017 16:58
WKWebView that resizes itself
import Foundation
import WebKit
// See https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/AdoptingCocoaDesignPatterns.html for more details.
private var observerContext = 0
class StackableWebView: WKWebView {
// Keep track of height which will change when the view is loaded.
var webViewHeight: CGFloat = 0.0
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

let a: Double? = 1.0
let b: Double? = 2.0
let c: Double? = 3.0
let d: Double? = 4.0
let e: Double? = 5.0
let f: Double? = 6.0
let g: Double? = 7.0
extension Optional {
func `or`(_ value : Wrapped?) -> Optional {
@AshvinGudaliya
AshvinGudaliya / AGUploadImageWebServices.swift
Last active January 5, 2019 09:56
Multipart file/Images upload with parameters in Swift
//
// AGUploadImageWebServices.swift
// BaseProject
//
// Created by AshvinGudaliya on 27/02/18.
// Copyright © 2018 AshvinGudaliya. All rights reserved.
//
import UIKit