Skip to content

Instantly share code, notes, and snippets.

View rijieli's full-sized avatar
🍺

Roger Lee rijieli

🍺
View GitHub Profile
@stephancasas
stephancasas / NSApplication+NSResponderDebug.swift
Created March 18, 2024 20:35
An extension on NSApplication providing a computed property that describes the current responder chain.
//
// NSApplication+NSResponderDebug.swift
//
// Created by Stephan Casas on 3/18/24.
//
import Cocoa;
extension NSApplication {
@amosgyamfi
amosgyamfi / HelloAnimation.swift
Last active March 5, 2024 02:28
HelloAnimation.swift
//
// HelloAnimation.swift
// OpenvisionOS
//
// Created by Amos Gyamfi on 17.2.2024.
//
import SwiftUI
struct HelloAnimation: View {
@import Photos;
[PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) {
NSLog(@"PHAuthorizationStatus: %ld", status);
PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init];
fetchOptions.includeHiddenAssets = YES;
fetchOptions.includeAllBurstAssets = YES;
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithOptions:fetchOptions];
@thesailordev
thesailordev / Carthage2Cocoapods.md
Last active May 24, 2024 05:10
Convert a Carthage Dependency-Managed Project to Cocoapods

Carthage to Cocoapods

We recently had the need to align our frameworks to one dependency management system. Previously we were using Carthage and Cocoapods (or both) amongst different frameworks. The burden of supporting both platforms coupled with long build times on our CI/CD drew us away from Carthage. During this conversion I encountered several "gotcha" moments in our Xcode projects that I want to share with others who might be doing the same thing to get you to a clean Cocoapod based build.

Assumptions

  • You have a working knowledge of Carthage and Cocoapods
  • You have a working knowledge of Xcode project settings
@nazywamsiepawel
nazywamsiepawel / pause_resume.swift
Created January 4, 2016 22:01
Pause / Resume CABasicAnimation with Swift
func pauseAnimation(){
var pausedTime = layer.convertTime(CACurrentMediaTime(), fromLayer: nil)
layer.speed = 0.0
layer.timeOffset = pausedTime
}
func resumeAnimation(){
var pausedTime = layer.timeOffset
layer.speed = 1.0
layer.timeOffset = 0.0
@tomalrussell
tomalrussell / jekyll-new-post.py
Created February 12, 2015 10:09
Jekyll New Post
#! /usr/bin/env python3
import sys
import datetime
import os
# set title to command-line argument, or default
if (len(sys.argv) > 1):
title = sys.argv[1]
else: