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
#!/bin/sh | |
# Homebrew (Command Line and GUI) | |
brew upgrade | |
brew cask update | |
# RubyGems | |
sudo gem update | |
# Node.js Global | |
npm update -g | |
# Bower | |
bower update |
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
.2sf Nintendo DS Sound File | |
.2sflib Nintendo DS Audio Library File | |
.3ga 3GPP Audio File | |
.4mp 4-MP3 Database File | |
.5xb Line 6 POD HD500X Edit Bundle | |
.5xe Line 6 POD HD500X Edit Preset File | |
.5xs Line 6 POD HD500X Edit Setlist File | |
.669 UNIS Composer 669 Module | |
.6cm Six Channel Module | |
.8cm Eight Channel Module |
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
chsh -s `which fish` |
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
*~ | |
# Python | |
# | |
*.pyc | |
*.pyo | |
# macOS | |
# |
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
apt-get update && aptitude dist-upgrade -y && apt-get autoremove -y |
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
func when<T, U>(_ value: T, _ cases: [T:U], else elseCaseValue: U) -> U { | |
if let existingCaseValue = cases[value] { | |
return existingCaseValue | |
} | |
else { | |
return elseCaseValue | |
} | |
} |
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
var value = 1005 | |
print(ternary(if: value > 1000, then: "big", else: "small")) // OUTPUT: big | |
value = 5 | |
print(ternary(if: value > 1000, then: "big", else: "small")) // OUTPUT: small |
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
var value: String? = "test" | |
value <*> { print($0) } <> { print("value is nil") } // OUTPUT: test | |
value = nil | |
value <*> { print($0) } <> { print("value is nil") } // OUTPUT: value is nil |
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
// *** different ways a string can match using our pattern matching operator *** | |
enum StringMatchType { | |
case literal | |
case escapedRegularExpression | |
case regularExpression(withOptions: NSRegularExpression.Options) | |
} | |
/* *** example function that returns how the string matches against | |
a literal string and a regex pattern in default and case insensitive modes *** */ | |
func typeOfMatch(for string: String) -> StringMatchType? { |
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
/* *** implementation for using the RegexPattern struct that can specify both a | |
regex pattern and options in pattern matching *** */ | |
func ~=(lhs: RegexPattern, rhs: String) -> Bool { | |
return | |
try! NSRegularExpression( | |
pattern: lhs.pattern, | |
options: lhs.options | |
) | |
.numberOfMatches( | |
in: rhs, |