This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RealityKit | |
struct BillboardSystem: System { | |
static let query = EntityQuery(where: .has(BillboardComponent.self)) | |
init(scene: RealityKit.Scene) {} | |
func update(context: SceneUpdateContext) { | |
context.scene.performQuery(Self.query).forEach { entity in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIColor+ContrastChecker.swift | |
// Stay Inside | |
// | |
// Created by Ryan McLeod on 5/6/20. | |
// Copyright © 2020 Grow Pixel. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CAMediaTimingFunction.swift | |
import UIKit | |
extension CAMediaTimingFunction { | |
static let linear = CAMediaTimingFunction(name: .linear) | |
static let easeOut = CAMediaTimingFunction(name: .easeOut) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIBezierPath { | |
// Source: https://github.com/aderussell/string-to-CGPathRef/blob/0bd9350dc2100029f3ddb8d9667384841549ecd6/ARCGPathFromString/ARCGPathFromString.m | |
convenience init(attributedString: NSAttributedString) { | |
let letters = CGMutablePath() | |
let line = CTLineCreateWithAttributedString(attributedString as CFAttributedString) | |
let runArray = CTLineGetGlyphRuns(line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is not important but maybe useful to the regex */ | |
"this.is.a.reverse-dns.thing" = "Blackbox “Stealth” T-Shirt"; | |
/* This is not important but maybe useful to the regex */ | |
"this.is.another.reverse-dns.thing-it.can.have-hyphens" = "I’m a long string. | |
I also have line breaks and sometimes \"escaped quotation marks\" | |
📦 Oh and emojis."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
class Mento: UIView { | |
// The thickness ratio of our mento, 1.0 being a perfect sphere. | |
let mentoThicknessScale: CGFloat = 0.60 | |
let shape: UIView = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Moon.h | |
// Blackbox | |
// | |
// Created by Ryan McLeod on 12/2/14. | |
// Copyright (c) 2014 Ryan McLeod. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CAMediaTimingFunctions+Extended.swift | |
// Geiger | |
// | |
// Created by Ryan McLeod on 1/22/19. | |
// Copyright © 2019 Grow Pixel. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Maps one range onto another | |
// Example: [-50, 100] to [0, 1.0] | |
// Example: [0.2, 1.0] to [1.0, 0.0] | |
#define MAPRANGE(x, inputLow, inputHigh, outputLow, outputHigh) ({\ | |
__typeof(x) __x = (x); \ | |
__typeof(inputLow) __inputLow = (inputLow); \ | |
__typeof(inputHigh) __inputHigh = (inputHigh); \ | |
__typeof(outputLow) __outputLow = (outputLow); \ | |
__typeof(outputHigh) __outputHigh = (outputHigh); \ | |
(((__x - __inputLow) / (__inputHigh - __inputLow)) * (__outputHigh - __outputLow)) + __outputLow; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SharkfoodMuteSwitchDetector.h | |
// | |
// Created by Moshe Gottlieb on 6/2/13. | |
// Copyright (c) 2013 Sharkfood. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
NewerOlder