Skip to content

Instantly share code, notes, and snippets.

View aChase55's full-sized avatar

Alex Chase aChase55

  • Los Angeles
View GitHub Profile
@aChase55
aChase55 / nightly.yml
Created October 20, 2022 18:49
nightly build
name: Nightly Build
on:
workflow_dispatch:
schedule:
- cron: '0 0,12 * * *'
jobs:
nightly-build:
uses: ./.github/workflows/tag-builds.yml
secrets: inherit
@aChase55
aChase55 / export.sh
Created January 16, 2020 02:27
.env export
export $(cat .env.dev | xargs)
@aChase55
aChase55 / install_gtest_ubuntu.md
Created December 18, 2019 06:37 — forked from Cartexius/install_gtest_ubuntu.md
Install gtest in Ubuntu
@aChase55
aChase55 / StringOrInt.swift
Last active July 11, 2019 19:47
StringOrInt Codable
enum StringOrInt: Codable {
case string(String)
case int(Int)
init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let value = try? container.decode(Int.self) {
self = .int(value)
return
}
@aChase55
aChase55 / TextSlider.swift
Last active June 8, 2019 16:56
Text Slider
import SwiftUI
extension View {
public func offset(_ offset: CGPoint) -> Self.Modified<_OffsetEffect> {
self.offset(x: offset.x, y: offset.y)
}
}
struct ContentView : View {
@State var location: Double = 0
@aChase55
aChase55 / CGPointOffset.swift
Created June 6, 2019 02:58
SwiftUI CGPoint Offset
import SwiftUI
extension View {
public func offset(_ offset: CGPoint) -> Self.Modified<_OffsetEffect> {
self.offset(x: offset.x, y: offset.y)
}
}
struct ContentView : View {
@aChase55
aChase55 / SwiftUI+HexColors.swift
Last active December 5, 2020 21:43
SwiftUI Hex Colors
//Trying out a prefix operator
//I thought vertical elipses made sense, representative of rbg
prefix operator ⋮
prefix func ⋮(hex:UInt32) -> Color {
return Color(hex)
}
extension Color {
init(_ hex: UInt32, opacity:Double = 1.0) {
let red = Double((hex & 0xff0000) >> 16) / 255.0
@aChase55
aChase55 / UIImage+Loading.swift
Created February 18, 2019 23:51
Alamofire image
import Foundation
import Alamofire
import AlamofireImage
extension UIImageView {
func loadImage(_ url:String?) {
guard let url = url else { return }
Alamofire.request(url).responseImage {[weak self] response in
guard let self = self else { return }
if let image = response.result.value {
@aChase55
aChase55 / RoundedCornerView.h
Created January 4, 2019 23:19
Rounded Corner View
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface RoundedCornerView : UIView
@property (nonatomic) IBInspectable CGFloat cornerRadius;
@end
NS_ASSUME_NONNULL_END
@aChase55
aChase55 / gist:f095bf5f4586fcdc3ccfb859b3ff572e
Created November 3, 2018 19:38
Objc Random UIColor macro
#define RANDOM_COLOR [[UIColor alloc] initWithRed:arc4random()%256/256.0 green:arc4random()%256/256.0 blue:arc4random()%256/256.0 alpha:1.0]