Skip to content

Instantly share code, notes, and snippets.

View nameghino's full-sized avatar
🚀

Nico Ameghino nameghino

🚀
  • Ciudad Autonoma de Buenos Aires, Argentina
View GitHub Profile
@nameghino
nameghino / MJPEGImageView.swift
Created December 6, 2016 02:29
UIImageView subclass to deal with MJPEG streams
//
// MJPEGImageView.swift
// TestMJPEG
//
// Created by Nico Ameghino on 4/23/16.
// Copyright © 2016 Nicolas Ameghino. All rights reserved.
//
import UIKit
@nameghino
nameghino / padlock.txt
Created June 23, 2017 01:03
All 1139 english words that can be input in a wordlock padlock
["BAAL", "BACK", "BAIL", "BAIN", "BAIS", "BAIT", "BALD", "BALE", "BALK", "BALL", "BALT", "BAND", "BANE", "BANK", "BANT", "BARD", "BARE", "BARK", "BARN", "BART", "BASE", "BASK", "BASS", "BAST", "BATE", "BATS", "BATT", "BEAD", "BEAK", "BEAL", "BEAN", "BEAT", "BECK", "BEEK", "BEEN", "BEES", "BEET", "BEID", "BELD", "BELL", "BELT", "BELY", "BEND", "BENE", "BENN", "BENT", "BERE", "BERN", "BERT", "BESS", "BEST", "BIAS", "BICE", "BICK", "BIEN", "BILE", "BILK", "BILL", "BIND", "BINE", "BINK", "BINT", "BIOD", "BION", "BIOS", "BIRD", "BIRK", "BIRL", "BIRN", "BITE", "BITT", "BLAD", "BLAE", "BLAN", "BLAS", "BLAT", "BLAY", "BLEE", "BLET", "BLIP", "BLOT", "BOAT", "BOCE", "BOCK", "BOID", "BOIL", "BOIS", "BOLD", "BOLE", "BOLK", "BOLL", "BOLT", "BOND", "BONE", "BONK", "BONY", "BOOD", "BOOK", "BOOL", "BOON", "BOOT", "BORD", "BORE", "BORN", "BORT", "BOSE", "BOSK", "BOSN", "BOSS", "BOTE", "BOTT", "BRAD", "BRAE", "BRAN", "BRAT", "BRAY", "BRED", "BREE", "BRET", "BREY", "BRIN", "BRIT", "BROD", "BROT", "BUAL", "BUCK", "BULK", "BULL",
@nameghino
nameghino / overloading.swift
Last active July 22, 2017 21:26
Overloading Playground
class A { }
class B: A { }
class C: A { }
func play(_ a: A) {
print("playing with A")
}
func play(_ b: B) {
print("playing with B")
@nameghino
nameghino / enum-keys.swift
Created August 31, 2017 16:54
Dictionary extension to allow using enums (or any RawableType) as keys in a dictionary
protocol RawableKey {
associatedtype RawType
var rawValue: RawType { get }
}
extension Dictionary {
subscript<K: RawableKey>(enumKey: K) -> Value? {
get {
if let key = enumKey.rawValue as? Key {