This file contains 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
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 |
This file contains 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
Happy April 1st |
This file contains 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
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 |
This file contains 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
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; |
This file contains 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
protocol P { | |
func hello() | |
} | |
// Non generic class | |
class A { | |
// poroperty of type P | |
var prop: P |
This file contains 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
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 | |
} |
This file contains 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
// 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 |
This file contains 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 UIKit | |
extension UITableViewCell { | |
private static var className: String { | |
return String(self.self) | |
} | |
static func reuseIdentifier() -> String { | |
return className |
This file contains 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
# 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" | |
This file contains 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
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 { |
NewerOlder