This file contains hidden or 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 typewriter = document.getElementById('typewriter'); | |
| let index = 0; | |
| function type() { | |
| if (index < text.length) { | |
| typewriter.innerHTML = text.slice(0, index) + '<span class="blinking-cursor">|</span>'; | |
| index++; | |
| if (['!', '.', '\n'].includes(text[index-2])) { | |
| setTimeout(type, Math.random() * 1500); | |
| } else if (index % 10 == 0 && text[index-2] == ' ') { | |
| setTimeout(type, Math.random() * 600); |
This file contains hidden or 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
| # nvm | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh" # This loads nvm | |
| [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion | |
| autoload -U add-zsh-hook | |
| load-nvmrc() { | |
| # this line exits when no .nvmrc file exists in the current directory | |
| # as a consequence of this, this script won't switch back to the default version, when leaving a directory containing a .nvmrc-file | |
| # when cpu gets faster in the future, it could make sense to remove this line again |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -au | |
| # Check cellar dir | |
| cellarDir=$(brew --prefix)/Cellar | |
| if [ ! -d "$cellarDir" ]; then | |
| echo "Not found. brew package path $cellarDir :(" | |
| echo | |
| exit 1 |
This file contains hidden or 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
| public class Euler { | |
| public static void main(String[] args) { | |
| print(euler(1, 2, 2)); | |
| print(euler(1, 2, 1)); | |
| print(euler(1, 2, 0.1)); | |
| print(euler(1, 2, 0.01)); | |
| print(euler(1, 2, 0.001)); | |
| print(euler(1, 2, 0.0001)); | |
| print(euler(1, 2, 0.00001)); |
This file contains hidden or 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
| public class Collatz36 { | |
| public static void main(String[] args) { | |
| int groupIndex = 0; | |
| int smallestGroupNumber = 0; | |
| int biggestGroupNumber = 0; | |
| for (int n = 101; n < 1000000; n++) { | |
| int stepIndex = 0; | |
| int step = n; | |
| while (stepIndex < 37 && step != 1) { |
This file contains hidden or 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 java.util.Arrays; | |
| public class Main { | |
| private char[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; | |
| private char[] operators = {'+', '*'}; | |
| private char[] basement = {'$', '_', '_', '_', '_', '_', '_', '_'}; | |
| private int basementPointer = 0; | |
| private char basementBottom = '$'; | |
| private char basementPlaceholder = '_'; |
This file contains hidden or 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
| public class Main { | |
| private char[] digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; | |
| private char[] operators = {'+', '*'}; | |
| private char[] basement = {'$', '_', '_', '_', '_', '_', '_', '_'}; | |
| private int basementPointer = 0; | |
| private char basementBottom = '$'; | |
| private char basementPlaceholder = '_'; | |
| private char[] word = {'3', '4', '+', '6', '2', '+', '*'}; |