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
custom_rules: | |
all_private_helpers_in_tests: | |
included: ".*Tests?\\.swift" | |
name: "All private mocks" | |
regex: "^(class|extension) (?!\\w+Tests?)" | |
message: "All helpers in tests should be private" | |
severity: warning |
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
# Creates pull request on develop branch with specified message (second line is desciption) | |
function hubd { | |
hub pull-request -b develop -m $1 | |
} | |
# Creates pull request on master branch with specified message (second line is desciption) | |
function hubm { | |
hub pull-request -b master -m $1 | |
} |
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
extension Sequence { | |
@warn_unqualified_access | |
public func min<T:Comparable>(by: (Element) throws -> T) rethrows -> Element? { | |
return try self.min { try by($0) < by($1) } | |
} | |
@warn_unqualified_access | |
public func max<T:Comparable>(by: (Element) throws -> T) rethrows -> Element? { | |
return try self.max { try by($0) > by($1) } | |
} | |
} |
NewerOlder