For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
import CloudKit | |
import Foundation | |
import Locksmith | |
/** | |
API Key used by this app is fetched from CloudKit. This class manages fetching and saving it into Keychain | |
*/ | |
class ApiKey { | |
private static let RECORD_NAME = <# RECORD_NAME_IN_CLOUDKIT #> | |
private static let KEY = <# KEY_NAME_IN_CLOUDKIT #> |
import SwiftUI | |
// pre-create one instance of MeasurementFormatter for our format needs | |
// re-use as needed | |
extension MeasurementFormatter { | |
static private let formatter: MeasurementFormatter = { | |
let formatter = MeasurementFormatter() | |
let numberFormatter = NumberFormatter() | |
numberFormatter.numberStyle = .decimal | |
numberFormatter.minimumFractionDigits = 2 |
public func CVPixelBufferGetPixelFormatName(pixelBuffer: CVPixelBuffer) -> String { | |
let p = CVPixelBufferGetPixelFormatType(pixelBuffer) | |
switch p { | |
case kCVPixelFormatType_1Monochrome: return "kCVPixelFormatType_1Monochrome" | |
case kCVPixelFormatType_2Indexed: return "kCVPixelFormatType_2Indexed" | |
case kCVPixelFormatType_4Indexed: return "kCVPixelFormatType_4Indexed" | |
case kCVPixelFormatType_8Indexed: return "kCVPixelFormatType_8Indexed" | |
case kCVPixelFormatType_1IndexedGray_WhiteIsZero: return "kCVPixelFormatType_1IndexedGray_WhiteIsZero" | |
case kCVPixelFormatType_2IndexedGray_WhiteIsZero: return "kCVPixelFormatType_2IndexedGray_WhiteIsZero" | |
case kCVPixelFormatType_4IndexedGray_WhiteIsZero: return "kCVPixelFormatType_4IndexedGray_WhiteIsZero" |
import Foundation | |
import CoreData | |
extension MyCoredataObject { | |
@nonobjc public class func createFetchRequest() -> NSFetchRequest<MyCoredataObject> { | |
return NSFetchRequest<MyCoredataObject>(entityName: "MyCoredataObject") | |
} | |
@NSManaged public var sortId: Int64 |
#!/bin/bash | |
cd /tmp && \ | |
/usr/lib/apt/apt-helper download-file http://debian.sur5r.net/i3/pool/main/s/sur5r-keyring/sur5r-keyring_2017.01.02_all.deb keyring.deb SHA256:4c3c6685b1181d83efe3a479c5ae38a2a44e23add55e16a328b8c8560bf05e5f && \ | |
sudo dpkg -i ./keyring.deb && \ | |
echo "deb http://debian.sur5r.net/i3/ $(grep '^DISTRIB_CODENAME=' /etc/lsb-release | cut -f2 -d=) universe" | sudo tee /etc/apt/sources.list.d/sur5r-i3.list && \ | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 0DF731E45CE24F27EEEB1450EFDC8610341D9410 && \ | |
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list && \ | |
sudo apt-get update && \ |
foo | bar | baz | |
---|---|---|---|
a | 1 | ||
b | 2 | ||
c | |||
4 | |||
e | 5 |