This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://p.events-delivery.apple.com.edgesuite.net/1509pijnedfvopihbefvpijlkjb/m3u8/hls_mvp.m3u8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DarkWindow.swift | |
// | |
// Created by Guilherme Rambo on 14/05/16. | |
// Copyright © 2016 Guilherme Rambo. All rights reserved. | |
// | |
import Cocoa | |
class DarkWindow: NSWindow { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LevenshteinEditDistance.swift | |
// | |
// Created by Guilherme Rambo on 01/09/16. | |
// Based on https://gist.github.com/shergin/a6dba6ee5ae3b9ecb16c | |
// Copyright © 2016 Guilherme Rambo. All rights reserved. | |
// | |
import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import WebKit | |
final class WebCacheCleaner { | |
class func clean() { | |
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast) | |
print("[WebCacheCleaner] All cookies deleted") | |
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Localize.py - Incremental localization on XCode projects | |
# João Moreno 2009 | |
# http://joaomoreno.com/ | |
# Modified by Steve Streeting 2010 http://www.stevestreeting.com | |
# Changes | |
# - Use .strings files encoded as UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
//: Basic implementation to apply different regexes over a card number String and find the card type | |
enum CardType:String, CustomStringConvertible { | |
case invalid = "Not valid" | |
case visa = "^4[0-9]{6,}$" | |
case mastercard = "^5[0-9]{6,}$" | |
case amex = "^3[47][0-9]{13}$" | |
case diners = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
A better way to "store value types" in NSUserDefaults or NSUbiquitousKeyValueStore | |
*/ | |
import Foundation | |
/// ValueCoder is a class that can encode values of a specific type via NSCoding | |
protocol ValueCoder: NSObjectProtocol, NSCoding { | |
/// The type this coder can encode/decode | |
associatedtype ValueType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CKContainer.default().accountStatus { status, error in | |
if let error = error { | |
// some error occurred (probably a failed connection, try again) | |
} else { | |
switch status { | |
case .available: | |
// the user is logged in | |
case .noAccount: | |
// the user is NOT logged in | |
case .couldNotDetermine: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CKRecord { | |
subscript(key: MovieKey) -> Any? { | |
get { | |
return self[key.rawValue] | |
} | |
set { | |
self[key.rawValue] = newValue as? CKRecordValue | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum MovieKey: String { | |
case title | |
case releaseDate | |
case location | |
case rating | |
} |