Skip to content

Instantly share code, notes, and snippets.

View smokyonion's full-sized avatar

Vincent Wayne smokyonion

View GitHub Profile
@smokyonion
smokyonion / SoldierDeployment.swift
Last active October 6, 2022 16:30
Observe Properties of Element in Swift.Array using ReactiveSwift
import ReactiveSwift
/// Problem to Solve
class Soldier {
let name: Property<String>
let deployed: MutableProperty<Bool> = MutableProperty(false)
init(_ name: String) {
self.name = Property(value: name)
@smokyonion
smokyonion / SpinlockTestTests.swift
Created May 30, 2017 17:47 — forked from steipete/SpinlockTestTests.swift
Updated for Xcode 8, Swift 3; added os_unfair_lock
//
// SpinlockTestTests.swift
// SpinlockTestTests
//
// Created by Peter Steinberger on 04/10/2016.
// Copyright © 2016 PSPDFKit GmbH. All rights reserved.
//
import XCTest
@smokyonion
smokyonion / introrx.md
Created April 18, 2017 22:32 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@smokyonion
smokyonion / GenericDelegate.swift
Created August 26, 2016 17:03
Generic Delegate Pattern in Swift 3
public protocol DataSource: class {
associatedtype AbstractType
func source() -> AbstractType
}
class ViewController<T: DataSource>: UIViewController {
weak var dataSouce: T?
typealias AbstractType = T.AbstractType
@smokyonion
smokyonion / fixXcode6OnElCapitan.sh
Created July 13, 2016 18:06 — forked from DaveWoodCom/fixXcode6OnElCapitan.sh
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## 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 copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
@smokyonion
smokyonion / NSFileHandle+Z.swift
Created July 6, 2016 18:33 — forked from codelynx/NSFileHandle+Z.swift
Utility methods Reading and Writing Integer, Float, Double for NSFileHandle
//
// NSFileHandle+Z.swift
// ZKit
//
// Created by Kaz Yoshikawa on 2/18/16.
//
//
import Foundation
@smokyonion
smokyonion / Podfile
Last active August 29, 2015 14:01
My Podfile
platform :ios, '7.0' #or platform :osx, '10.7'
# exclusive pod
target :'MyXcodeProjectTarget', :exclusive => true do
pod 'ReactiveCocoa', '~> 2.3'
end
# shared pod
pod 'OCMock', '~> 2.2'
@smokyonion
smokyonion / gist:9418843
Created March 7, 2014 20:01
Xcode Git Version Script
git_version=$(git log -1 --format="%h")
info_plist="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion '${git_version}'" "${info_plist}"
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"