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 $@ | |
# store arguments in a special array | |
args=("$@") | |
# get number of elements | |
ELEMENTS=${#args[@]} | |
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
val kotlinKeywordsAndSymbols = | |
mutableListOf( | |
"as", | |
"as?", | |
"break", | |
"class", | |
"continue", | |
"do", | |
"else", | |
"false", |
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
# Install homebrew, if is not already installed: | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Update and upgrade homebrew, if needed: | |
brew update && brew upgrade | |
# Install XCode (it is a long download, it is an Octave dependency) | |
# Go to Apple Store and install. | |
# Install Aquaterm |
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
infix fun <A, B, C> ((A) -> B).andThen(g: (B) -> C): (A) -> C = { a: A -> g(this(a)) } | |
val c = a andThen b |
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 kotlin.reflect.KMutableProperty1 | |
inline fun <reified T, Y> MutableList<T>.arrayListOfField(property: KMutableProperty1<T, Y?>): ArrayList<Y> { | |
val output = ArrayList<Y>() | |
this.forEach {t: T -> | |
@Suppress("UNCHECKED_CAST") | |
output.add(property.get(t) as 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
To fix the error: | |
`xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun` | |
You can do: | |
`xcode-select --install` | |
More info on: | |
`https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path` |
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
/** | |
* | |
* @param classNames | |
* @param className | |
* @returns {boolean} | |
*/ | |
export function hasClass(classNames, className) { | |
return new RegExp(` ${className} `).test(` ${classNames} `) | |
} |
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
# Official documentation: https://nodejs.org/en/download/package-manager/ | |
# First install npm using the link above (if you don't have it yet). Then: | |
# sudo is needed for some OSes, if it is not required on yours then you can remove it from the commands. | |
sudo npm install npm@latest -g | |
#Important! The option -f is used to force clean the npm cache. Take care about it. Anyway, I usually do this when I would like to install the latest NodeJS. | |
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable |
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
# Official rvm documentation: https://rvm.io/ | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash | |
rvm install ruby --latest | |
gem install rails |