Skip to content

Instantly share code, notes, and snippets.

tjluoma /
Last active Jul 30, 2020
zsh script to compare macOS Versions - see for full explanation
#!/bin/zsh -f
# Purpose: Check to see if we are running on Big Sur
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-07-10
# this will check to make sure `sw_vers` exists
SergLam / UIDevice+Ext.swift
Created Jun 14, 2019
Detect iOS device model
View UIDevice+Ext.swift
public extension UIDevice {
enum DeviceModelName: String {
case undefined
case iPodTouch5
case iPodTouch6
case iPhone4
case iPhone4s
case iPhone5
View WWDC.2019.Combine.kvo.swift
@available(iOS 13.0, *)
func exampleCombineKVO () {
let article = Article(title: "Test", body: "Lorum ipsum")
// For a KeyPath 101, see
let keypath: ReferenceWritableKeyPath<Article,String> = \.title
// The new Combine stuff:
let sink = Subscribers.Assign(object: article, keyPath: keypath)
let source = Publishers.Future<String, Never> { subscriber in
View CodeTextField.swift
import UIKit
class CodeTextField: UITextField, UITextFieldDelegate {
let codeLength: Int
var characterSize: CGSize
var characterSpacing: CGFloat
let textPreprocess: (String) -> String
let validCharacterSet: CharacterSet
novemberfiveco-gists / WKCookieWebView.swift
Last active Aug 27, 2020
A WKWebView subclass that passes cookies after a 302 redirect response.
View WKCookieWebView.swift
// WKCookieWebView.swift
// Created by Jens Reynders on 30/03/2018.
// Copyright (c) 2018 November Five
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View gist:97e9e3d60c39ce4aac647a77534d4ebf
@implementation AppHostCookie
+ (NSMutableArray<NSString *> *)cookieJavaScriptArray
NSMutableArray<NSString *> *cookieStrings = [[NSMutableArray alloc] init];
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
Jpoliachik / index.ios.js
Last active Feb 26, 2020
ReactNative LayoutAnimation Example
View index.ios.js
'use strict';
import React, {
} from 'react-native';
View SRCopyableLabel.swift
// SRCopyableLabel.swift
// Created by Stephen Radford on 08/09/2015.
// Copyright (c) 2015 Cocoon Development Ltd. All rights reserved.
import UIKit
class SRCopyableLabel: UILabel {
View WhyRSS
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<title>Subscriptions - WHY</title>
<outline text="cool" title="cool">
<outline htmlUrl="" title="kedebug" xmlUrl="" type="rss" text="kedebug"/>
<outline htmlUrl="" title="Lucida" xmlUrl="" type="rss" text="Lucida"/>
<outline htmlUrl="" title="Web前端 腾讯AlloyTeam Blog | 愿景: 成为地球卓越的Web团队!" xmlUrl="" type="rss" text="Web前端 腾讯AlloyTeam Blog | 愿景: 成为地球卓越的Web团队!"/>
ryanhanwu / build.config
Last active Jul 9, 2019
My iOS IPA build script for XCode workspace with CocoaPods installed
View build.config
#Code Sign
DEVELOPER_NAME="iPhone Developer: XXXXXXXX (2CA66F8Y8L)"
You can’t perform that action at this time.