Skip to content

Instantly share code, notes, and snippets.

View kasimok's full-sized avatar
💭
Moving to AI

kakaiikaka kasimok

💭
Moving to AI
View GitHub Profile
@kasimok
kasimok / CalculatorView.swift
Last active March 8, 2022 00:54 — forked from natecook1000/CalculatorView.swift
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
import UIKit
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
@kasimok
kasimok / KeychainService.swift
Created November 11, 2020 11:06 — forked from alexbosworth/KeychainService.swift
Swift Keychain Class
import UIKit
import Security
let serviceIdentifier = "com.company"
let accessGroup = "com.company.app"
let kSecClassValue = kSecClass as NSString
let kSecAttrAccountValue = kSecAttrAccount as NSString
let kSecValueDataValue = kSecValueData as NSString
let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString
@kasimok
kasimok / levenshtein.swift
Created January 3, 2018 09:33 — forked from bgreenlee/levenshtein.swift
Levenshtein Distance in Swift
/**
* Levenshtein edit distance calculator
* Usage: levenstein <string> <string>
*
* To compile:
* sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer
* xcrun swift -sdk $(xcrun --show-sdk-path --sdk macosx) levenshtein.swift
*/
import Foundation
@kasimok
kasimok / gist:614dafef4be1f7ec3247ae68c51ccf37
Created June 10, 2016 08:07 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt