Skip to content

Instantly share code, notes, and snippets.

View PaulTaykalo's full-sized avatar

Paul Taykalo PaulTaykalo

View GitHub Profile
@PaulTaykalo
PaulTaykalo / .zshrc
Created November 6, 2023 22:46
Re-request all Revieers Again
function re_request_reviews {
# Get the details of latest reviews
local latest_reviews=$(gh pr view --json latestReviews -q '.latestReviews[] | select(.state != "APPROVED") | .author.login')
# Create an empty string variable to aggregate the reviewer list
local reviewers=""
# Loop through the list of reviewers who haven't approved and add each one to the reviewer list
for reviewer in $latest_reviews; do
Happy April 1st
@PaulTaykalo
PaulTaykalo / AppKit.pcm
Created March 18, 2023 22:10
-module-file-info output for AppKit
Information for module file 'ProjectDir/.build/DerivedData/ModuleCache.noindex/1UER563BX8AHK/AppKit-1LWHB1MWS5AWP.pcm':
Module format: raw
Generated by this Clang: (clang-1400.0.29.202)
Module name: AppKit
Module map file: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/AppKit.framework/Modules/module.modulemap
Imports module 'Foundation': ProjectDir/.build/DerivedData/ModuleCache.noindex/1UER563BX8AHK/Foundation-2FJBXN8U6QRTS.pcm
Imports module 'CoreFoundation': ProjectDir/.build/DerivedData/ModuleCache.noindex/1UER563BX8AHK/CoreFoundation-RZX25862PY17.pcm
Imports module 'Darwin': ProjectDir/.build/DerivedData/ModuleCache.noindex/1UER563BX8AHK/Darwin-1IVCWVLR6MT9T.pcm
Imports module 'CoreGraphics': ProjectDir/.build/DerivedData/ModuleCache.noindex/1UER563BX8AHK/CoreGraphics-MC4FPA2MN9QR.pcm
Imports module 'IOKit': ProjectDir/.build/DerivedData/ModuleCache.noindex/1UER563BX8AHK/IOKit-PMP3SCKMT7TH.pcm
const removeEmptyValues = val => {
const isInvalid = value => value === null || value === '' || value === false;
if (isInvalid(val)) return;
if (Array.isArray(val)) {
return val.map(removeEmptyValues).filter(val => val !== undefined);
} else if (typeof val === 'object') {
const entries = Object.entries(val).filter(([, value]) => !isInvalid(value));
return Object.fromEntries(entries.map(([key, value]) => [key, removeEmptyValues(value)]));
}
return val;
protocol P {
func hello()
}
// Non generic class
class A {
// poroperty of type P
var prop: P
@PaulTaykalo
PaulTaykalo / autclosure.swift
Last active March 22, 2022 17:44
Strange generic? autoclosure?
struct Err: Error {}
open class ClosureContainer<Closure, Value> {
var arg: Closure?
}
func unwrap<T>(_ expression: @autoclosure () throws -> T?) throws -> T {
guard let value = try expression() else { throw Err() }
return value
}
// Debugging Builds
defaults write com.apple.dt.XCBuild EnableBuildDebugging -bool NO
// DEbugging Prebuilds
defaults write com.apple.dt.Xcode IDEShowPrebuildLogs YES
// DEbugging Indexing
defaults write com.apple.dt.Xcode IDEIndexShowLog -bool YES
import UIKit
extension UITableViewCell {
private static var className: String {
return String(self.self)
}
static func reuseIdentifier() -> String {
return className
@PaulTaykalo
PaulTaykalo / Appfile
Created August 26, 2016 13:05
Fastlane's Appfile for multiple users support
# In big teams instead of specifying one email to rule them all as apple_id
# You can get this information from environment variable
# By doing this it will allow different developers to specify their own apple ids
# And if this env variable is not required - then it will be asked on any command that requires apple_id
apple_id ENV["MY_APP_NAME_APPLE_ID"] # Your Apple email address
### ~/.bashrc of some user
export MY_APP_NAME_APPLE_ID="someuser@gmail.com"
let a: Double? = 1.0
let b: Double? = 2.0
let c: Double? = 3.0
let d: Double? = 4.0
let e: Double? = 5.0
let f: Double? = 6.0
let g: Double? = 7.0
extension Optional {
func `or`(_ value : Wrapped?) -> Optional {