Skip to content

Instantly share code, notes, and snippets.

View Arrlindii's full-sized avatar

Arlind Aliu Arrlindii

  • Munich, Germany
View GitHub Profile
@saiday
saiday / RxSwiftExample.swift
Last active February 23, 2022 06:03
RxSwift callback chaining
func fetchUserId() -> Observable<String> {
return create{ (observer) -> Disposable in
Client.fetchUserId() { [unowned self]
(userId: String?, err: ErrorType?) -> Void in
if let _ = err{
observer.on(Event.Error(err!))
} else {
observer.on(Event.Next(userId))
observer.on(Event.Completed)
}
@onedayitwillmake
onedayitwillmake / gist:3288507
Created August 7, 2012 19:12
Rotating in GLSL
// Simple Lambertian lighting
// Mario Gonzalez
//
// Based on 'WebGL - A Beginners Guide'
attribute vec3 aVertexPosition;
attribute vec3 aVertexNormal;
uniform vec3 rotation;
uniform mat4 uMVMatrix;