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
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
#!/bin/sh | |
brew cask install acorn | |
brew cask install alcatraz | |
brew cask install alfred | |
brew cask install anybar | |
brew cask install appcleaner | |
brew cask install atom | |
brew cask install audacity | |
brew cask install audio-hijack | |
brew cask install bartender |
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
#!/bin/bash | |
echo $(ls ~/Library/Caches/Metadata/Safari/History | wc -l) websites in history |
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/bash | |
echo $(ls ~/Library/Caches/Metadata/Safari/Bookmarks | wc -l) bookmarks |
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
*~ | |
# 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
agnoster | |
bang-bang | |
battery | |
bobthefish | |
brew | |
default | |
fasd | |
gem | |
git-flow | |
python |