Skip to content

Instantly share code, notes, and snippets.

View mitchellporter's full-sized avatar

Mitchell Porter mitchellporter

  • Seattle, WA
View GitHub Profile
@mitchellporter
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 {
startShimmering()
@mitchellporter
mitchellporter / questions.md
Created January 18, 2024 01:30 — forked from oguzhanvarsak/questions.md
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
mitchellporter / README.md
Created January 30, 2020 16:27 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@mitchellporter
mitchellporter / Mento.playground
Created July 31, 2019 21:22 — forked from warpling/Mento.playground
Copying Tinder's "mentos" button animation (based on tweet: https://twitter.com/warpling/status/930567671015358464?s=20)
//: 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
mitchellporter / iterm2-solarized.md
Created July 22, 2019 22:12 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mitchellporter
mitchellporter / README.md
Created May 30, 2019 16:44 — forked from acrookston/README.md
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 preaction.sh into the pre-action script box.

@mitchellporter
mitchellporter / README.md
Created February 20, 2019 23:00 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

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

Parent

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

iframe

@mitchellporter
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:
https://shopify-selectors.myshopify.com/admin/themes
*/
/*====================================
Product Page and Quick View