Skip to content

Instantly share code, notes, and snippets.

View thexande's full-sized avatar

Alexander Murphy thexande

  • Ibotta
  • Denver, CO, USA, Planet Earth
View GitHub Profile

Privacy Policy

Alexander Murphy built the Popcorn Hour app as a Free app. This SERVICE is provided by Alexander Murphy at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Popcorn Hour unless otherwise defined in this Privacy Policy.

@thexande
thexande / .xcodesamplecode.plist
Created February 16, 2019 17:11
Add this file to your .xcworkspace to render markdown resources within Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
.xcodesamplecode.plist
movies
Created by Alexander Murphy on 2/10/19.
Copyright (c) 2019 Alexander Murphy. All rights reserved.
-->
<plist version="1.0">
@thexande
thexande / replace.sh
Created February 16, 2019 04:40
Replace string across entire version history
git filter-branch --tree-filter "find . -type f -exec sed -i -e 's/originalpassword/newpassword/g' {} \;"
@thexande
thexande / dictionaryToJson.swift
Created February 13, 2019 03:53
Convert Dictionary to JSON in Swift
extension Dictionary {
var jsonStringRepresentaiton: String? {
guard let theJSONData = try? JSONSerialization.data(withJSONObject: self,
options: [.prettyPrinted]) else {
return nil
}
return String(data: theJSONData, encoding: .ascii)
}
}
@thexande
thexande / result.swift
Created February 9, 2019 22:10
`Result<T>` vs multi closure
enum Result<T, Error> {
case success(T)
case failure(Error)
}
func resultCallback(completion: @escaping((Result<Int, Error>) -> Void)) {
}
func multiCompletionCallback(success: ((Int) -> Void)?,
@thexande
thexande / fib.swift
Created February 6, 2019 23:11
Fib implementation in swift
func fib(arr: [Int]) -> [Int] {
if arr.count > 10 {
return arr
}
guard
let last = arr.last,
@thexande
thexande / Debouncer.swift
Created February 5, 2019 20:09
Debounce implementation in swift
import Foundation
final class Debouncer: NSObject {
var callback: (() -> Void)
var delay: Double
weak var timer: Timer?
init(delay: Double, callback: @escaping (() -> Void)) {
self.delay = delay
self.callback = callback
@thexande
thexande / Stack.swift
Created January 29, 2019 16:49
Swift Stack Implementation
struct Stack<T> {
private var stack: [T] = []
mutating func push(_ item: T) {
stack.append(item)
}
mutating func pop() -> T {
return stack.removeLast()
import Foundation
import CoreGraphics
import SDWebImage
final class ImageAspectRatioCache {
var aspectLookup: [URL:CGFloat] = [:]
func produceAspectRatios(for images: [URL], completion: (() -> Void)?) {

Privacy Policy

Alexander Murphy built the Coin Viewer app as a Free app. This SERVICE is provided by Alexander Murphy at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Coin Viewer unless otherwise defined in this Privacy Policy.