Skip to content

Instantly share code, notes, and snippets.

Avatar

Bill Thompson eSpecialized

View GitHub Profile
@eSpecialized
eSpecialized / rxy.swift
Last active Apr 14, 2018
Simple RxSwift
View rxy.swift
import RxSwift
let bag = DisposeBag()
let publisher = PublishSubject<Int>()
publisher
.ignoreElements()
.subscribe(onCompleted: {
print("completed")
@eSpecialized
eSpecialized / handleThread.java
Created Mar 19, 2018
Android Posting code to main thread using native java calls, aka handlers simplified with block calls posted to another thread
View handleThread.java
//You will want to create a Handler on the thread you wish to post code too.
// This makes Android development using code blocks far easier just like it can be on iOS.
public Handler mThreadHandler;
public void setupHandlerFromThreadMain() {
//Looper.prepare();
//if you are setting this up from the Main thread, then there is already a looper.
mThreadHandler = new Handler();
//Looper.loop();
@eSpecialized
eSpecialized / AttributedStringViewPlayground.swift
Last active Feb 17, 2018
Swift 4.1 UITextView, Playground, UnsafeMutablePointer<ObjCBool> in a closure, finding ranges, adding attributes to attributed text
View AttributedStringViewPlayground.swift
//: A UIKit based Playground for presenting A Textview with Attributed String text
//: Demonstrates the use of 'stop: UnsafeMutablePointer<ObjCBool>' parameter in the block of code by using 'stop[0]=true'
//: Show the assistant editor to see the Text view output.
// designed with Swift 4.1
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {