Skip to content

Instantly share code, notes, and snippets.

View eSpecialized's full-sized avatar

Bill Thompson eSpecialized

View GitHub Profile
@eSpecialized
eSpecialized / rxy.swift
Last active April 14, 2018 14:40
Simple RxSwift
import RxSwift
let bag = DisposeBag()
let publisher = PublishSubject<Int>()
publisher
.ignoreElements()
.subscribe(onCompleted: {
print("completed")
@eSpecialized
eSpecialized / handleThread.java
Created March 19, 2018 19:41
Android Posting code to main thread using native java calls, aka handlers simplified with block calls posted to another thread
//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 February 17, 2018 14:46
Swift 4.1 UITextView, Playground, UnsafeMutablePointer<ObjCBool> in a closure, finding ranges, adding attributes to attributed text
//: 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() {