Skip to content

Instantly share code, notes, and snippets.

View ukiyoevega's full-sized avatar
🕳️
puffing

Wei ukiyoevega

🕳️
puffing
View GitHub Profile
@mdiep
mdiep / diff-values.swift
Created February 4, 2020 13:02
Diff values with Mirror and AnyHashable
import Foundation
// Diff values for better test assertions.
//
// Enums and collections left as an exercise for the reader.
// A difference between two values
struct Difference: CustomStringConvertible {
let path: String
let actual: String
//
// Example of Using AVAudioPlayer
// to play a buffer of (synthesized) audio samples from memory
// by converting a [Float] buffer into an in-memory WAV file
//
// Copyright © 2019 Ronald H Nicholson Jr. All rights reserved.
// (re)Distribution permitted under the 3-clause New BSD license.
//
import Foundation
@inamiy
inamiy / RxSwift-KVO-methodInvoked-collision.swift
Created April 16, 2018 13:17
RxSwift v4.0.0 KVO + methodInvoked collision
example("Crash") {
let scrollView = UIScrollView()
scrollView.rx.observe(CGSize.self, "contentSize").subscribe()
scrollView.rx.methodInvoked(#selector(UIScrollView.layoutSubviews)).subscribe()
// --- Unhandled error happened: Collision between RxCocoa interception mechanism and KVO. To resolve this conflict please use this interception mechanism first. example ---
// Unhandled error happened: Collision between RxCocoa interception mechanism and KVO. To resolve this conflict please use this interception mechanism first.
// Target: <UIScrollView: 0x7fa397810600; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x60c000042820>; layer = <CALayer: 0x60c00002d660>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}>
// subscription called from:
@hotpaw2
hotpaw2 / RecordAudio.swift
Last active April 3, 2024 03:10
Swift Audio Recording class. Reads buffers of input samples from the microphone using the iOS RemoteIO Audio Unit API
//
// RecordAudio.swift
//
// This is a Swift class (updated for Swift 5)
// that uses the iOS RemoteIO Audio Unit
// to record audio input samples,
// (should be instantiated as a singleton object.)
//
// Created by Ronald Nicholson on 10/21/16.
// Copyright © 2017,2019 HotPaw Productions. All rights reserved.
@jmenbo
jmenbo / upgrade_openssh_on_os_10.9.x.md
Last active May 9, 2024 19:55
Manually upgrade OpenSSH on OS 10.9.x

Manually upgrade OpenSSH on OS 10.9.x

NOTE: Installation and testing was done on a clean Mavericks (OS 10.9) installation

Install Brew:

Install Homebrew prereqs:

xcode-select --install

Install Homebrew