- navigation tricks with cd, pushd, popd
- some keyboard shortcuts
- using history as turbo
- source vs sh
- running processes in background, nohup
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
package com.example.rx; | |
import rx.*; | |
import java.util.Collections; | |
import java.util.Deque; | |
import java.util.List; | |
import java.util.concurrent.ConcurrentLinkedDeque; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import java.util.concurrent.atomic.AtomicInteger; |
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
export CLICOLOR=1 | |
PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007" |
It is a named collection of method signatures. Those method signatures are called properties.
We should be careful not to confuse classes or traits and types, because they are different things. Every class and trait gives rise to a type with the same name, but in itself is not a type. Many types also exist which do not solely correspond to a trait or a class.
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
def factorial(n: Int): Int = if (n > 1) n * factorial(n - 1) else 1 | |
@scala.annotation.tailrec | |
def tailFactorial(n: Int, acc: Int = 1): Int = | |
if (n == 1) acc | |
else tailFactorial(n - 1, n * acc) |
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
def fibonacci(n: Int): Int = | |
if (n == 0) 0 | |
else if (n == 1) 1 | |
else fibonacci(n - 1) + fibonacci(n - 2) | |
@scala.annotation.tailrec | |
def tailFibonacci(n: Int, prev: Int = 0, acc: Int = 1): Int = | |
if (n == 0) prev | |
else if (n == 1) acc | |
else tailFibonacci(n - 1, acc, acc + prev) |