Skip to content

Instantly share code, notes, and snippets.

@ppave
ppave / observable.swift
Created June 1, 2021 10:54 — forked from rnapier/observable.swift
New Observable idea
import Foundation
class Disposable {
let dispose: () -> Void
init(dispose: @escaping () -> Void) { self.dispose = dispose }
deinit {
dispose()
}
}
import Foundation
public class Disposable {
private var isDisposed = false
private let _dispose: () -> Void
public func dispose() {
if !isDisposed {
_dispose()
isDisposed = true
}
@ppave
ppave / debounce-throttle.swift
Created June 4, 2021 13:28 — forked from simme/debounce-throttle.swift
Swift 3 debounce & throttle
//
// debounce-throttle.swift
//
// Created by Simon Ljungberg on 19/12/16.
// License: MIT
//
import Foundation
extension TimeInterval {
@ppave
ppave / AppDelegate.m
Created June 4, 2022 17:38 — forked from albertodebortoli/AppDelegate.m
iPhone splash screen fade out animation
// in application:didFinishLaunchingWithOptions: in app delegate
// before [window makeKeyAndVisible];
UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"background.png"];
// after [window makeKeyAndVisible];
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[window addSubview:splashView];
@ppave
ppave / core-image-filters-ios-13.md
Created March 19, 2024 15:17 — forked from JoshuaSullivan/core-image-filters-ios-13.md
An enumeration of iOS 13 Core Image filters.

Core Image Filters

iOS 13 has 218 filters.

New Filters in iOS 13

  • CIDocumentEnhancer
  • CIGaborGradients
  • CIKeystoneCorrectionCombined
  • CIKeystoneCorrectionHorizontal
  • CIKeystoneCorrectionVertical
@ppave
ppave / fragment_shader_tutorials.glsl
Created June 21, 2024 15:12 — forked from JBlackCat/fragment_shader_tutorials.glsl
GLSL Beginner Tutorials from ShaderToy.com
/*
by Uğur Güney. March 8, 2014.
Hi! I started learning GLSL a month ago. The speedup gained by using
GPU to draw real-time graphics amazed me. If you want to learn
how to write shaders, this tutorial written by a beginner can be
a starting place for you.
Please fix my coding errors and grammar errors. :-)