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
| brew install fish | |
| sudo grep -qxF $(which fish) /etc/shells || echo $(which fish) | sudo tee -a /etc/shells | |
| chsh -s $(which fish) | |
| fish | |
| fish_add_path /opt/homebrew/bin | |
| fish_update_completions |
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
| package utils | |
| func isValidLuhn(number string) bool { | |
| var sum int | |
| double := false | |
| for i := len(number) - 1; i >= 0; i-- { | |
| digit, err := strconv.Atoi(string(number[i])) | |
| if err != nil { |
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
| { | |
| "Приватбанк": [ | |
| 410653, | |
| 413051, | |
| 414939, | |
| 414943, | |
| 414949, | |
| 414960, | |
| 414961, | |
| 414962, |
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
| mkdir drivers | |
| cd drivers | |
| git clone https://github.com/cilynx/rtl88x2bu.git | |
| cd rtl88x2bu | |
| VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf) | |
| echo $VER | |
| sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER} | |
| sudo pacman -S dkms | |
| sudo dkms add -m rtl88x2bu -v ${VER} | |
| sudo pacman -Ss headers |
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
| # Source: https://www.w3resource.com/python-exercises/string/python-data-type-string-exercise-97.php | |
| from re import sub | |
| def snake_case(string: str) -> str: | |
| return '_'.join( | |
| sub( | |
| '([A-Z][a-z]+)', r' \1', | |
| sub( | |
| '([A-Z]+)', r' \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 re | |
| def camel_to_snake_case(name: str) -> str: | |
| """ | |
| Convert string in CamelCase to string in snake_case. | |
| Example: CamelCase -> camel_case | |
| :param name: string in camel case | |
| :return: string in snake case |
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 testArray = [1, 6, 4, 2, 6, 4]; | |
| function sortArray(array) { | |
| let needToSortAgain = false; | |
| for(let index = 0; index < array.length -1; index++) { | |
| let firstNumber = array[index]; | |
| let secondNumber = array[index + 1]; | |
| array[index] = firstNumber < secondNumber ? firstNumber : secondNumber; |