Skip to content

Instantly share code, notes, and snippets.

View mitchellporter's full-sized avatar

Mitchell Porter mitchellporter

  • Seattle, WA
View GitHub Profile
mitchellporter / UIView+Shimmering.swift
Created January 25, 2024 18:33 — forked from antonio081014/UIView+Shimmering.swift
Shimmering Effect for UIView
import UIKit
extension UIView {
public var isShimmering: Bool {
get {
return layer.mask?.animation(forKey: shimmerAnimationKey) != nil
set {
if newValue {
mitchellporter /
Created January 18, 2024 01:30 — forked from oguzhanvarsak/
Interview Questions for iOS Developers

Interview Questions for iOS Developers

1. Classes vs structs

In Swift, structs are value types whereas classes are reference types. When you copy a struct, you end up with two unique copies of the data. When you copy a class, you end up with two references to one instance of the data. It’s a crucial difference, and it affects your choice between classes or structs. (+ Class extendable, struct does not.)

2. What’s the difference between var and let? Which one would you choose for properties in a struct and why?

Both let and var are for creating variables in Swift. let helps you create immutable variables (constants) while on the other hand var creates mutable variables.

3. What does the mutating keyword mean?

The mutating keyword lets callers know that the method is going to make the value change.

mitchellporter /
Created January 30, 2020 16:27 — forked from nikcub/
Facebook PHP Source Code from August 2007
mitchellporter / Mento.playground
Created July 31, 2019 21:22 — forked from warpling/Mento.playground
Copying Tinder's "mentos" button animation (based on tweet:
//: Playground - noun: a place where people can play
import UIKit
class Mento: UIView {
// The thickness ratio of our mento, 1.0 being a perfect sphere.
let mentoThicknessScale: CGFloat = 0.60
let shape: UIView = {
mitchellporter /
Created July 22, 2019 22:12 — forked from kevin-smets/
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)





mitchellporter /
Created May 30, 2019 16:44 — forked from acrookston/
Xcode pre-action to build custom Info.plist

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of into the pre-action script box.

mitchellporter /
Created February 20, 2019 23:00 — forked from pbojinov/
Two way iframe communication- Check out working example here:

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.


Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')


mitchellporter / selectors.js
Created November 20, 2018 22:02 — forked from carolineschnapp/selectors.js
Shopify jQuery selectors.
To test things out, in your JavaScript console, use selector followed by
.css('outline','1px solid red');
to see what you get.
A sandbox to test all this:
Product Page and Quick View