Skip to content

Instantly share code, notes, and snippets.

View jasorod's full-sized avatar

Jason Rodriguez jasorod

View GitHub Profile
@jasorod
jasorod / blue_noise_gen.cu
Last active August 22, 2019 17:37
Blue Noise Generator
/*
* Blue noise dithered sampling algorithm based on the paper "Blue-noise Dithered Sampling" by Georgiev and Fajardo
* Uses simulated anealing to calculate a blue noise image from a random set of values
*
* Program will output a PGM file for the first dimension of the random noise image and the blue noise image
*
* compile: nvcc -O3 --std=c++14 -o blue_noise_gen blue_noise_gen.cu
*
*/
import UIKit
extension UIAlertController {
public enum TextInputResult {
/// The user tapped Cancel.
case cancel
/// The user tapped the OK button. The payload is the text they entered in the text field.
case ok(String)
}
@jasorod
jasorod / KeyboardNotification.swift
Last active August 7, 2019 10:13 — forked from kristopherjohnson/KeyboardNotification.swift
Swift convenience wrapper for the userInfo values associated with a UIKeyboard notification
import UIKit
/// Wrapper for the NSNotification userInfo values associated with a keyboard notification.
///
/// It provides properties that retrieve userInfo dictionary values with these keys:
///
/// - UIKeyboardFrameBeginUserInfoKey
/// - UIKeyboardFrameEndUserInfoKey
/// - UIKeyboardAnimationDurationUserInfoKey
/// - UIKeyboardAnimationCurveUserInfoKey
@jasorod
jasorod / SKTimingFunction.swift
Created December 5, 2017 19:40 — forked from takuoka/SKTimingFunction.swift
This is the TimingFunction class like CAMediaTimingFunction available in AnyWhere also SpriteKit. All the cool animation curves from `CAMediaTimingFunction` but it is limited to use with CoreAnimation. See what you can do with cubic Bezier curves here: http://cubic-bezier.com
//
// SKTimingFunction.swift
// Pods
//
// Created by Takuya Okamoto on 2015/10/06.
//
//
// inspired by https://gist.github.com/raphaelschaad/6739676
//
// ListDiff.swift
// cbnnews
//
// Created by Rodriguez, Jason on 11/18/17.
// Copyright © 2017 cbn. All rights reserved.
//
// From "A Technique for Isolating Differences Between Files" by Paul Heckel, Communications of the ACM, Volume 21(4), April 1978, pp. 264-268
//
@jasorod
jasorod / SVGPath.swift
Last active January 31, 2024 19:13 — forked from dotcypress/SVGPath.swift
SVG path to CGPath converter
//
// SVGPath.swift
// SVGPath
//
// Created by Tim Wood on 1/21/15.
// Updated by Vitaly Domnikov 10/6/2015
// Updated by Jason Rodriguez 08/29/2017
// Copyright (c) 2015 Tim Wood, Vitaly Domnikov, Jason Rodriguez. All rights reserved.
import Foundation