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
###### | |
## A reminder of how ruby's access scope works in inheritance | |
## public: can be called by ownself, any other class | |
## protected: can be called by ownself, sibling class | |
## private: can be called by ownself | |
###### | |
class Animal | |
attr_reader :breed | |
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
function x1(value) { | |
return ( | |
Object.is(value, undefined) || | |
Object.is(value, null) | |
); | |
} | |
function x2(val1, val2, val3) { | |
return ( | |
val1 >= val2 && |
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
# shortcut to a declared environment variable to a directory | |
# eg. declare myrepo=~/Documents/repo | |
# then do 'to myrepo' will be equivalent to 'cd ~/Documents/repo' | |
function to() { | |
if [ -z "$1" ]; then | |
echo "Empty argument" | |
return | |
fi | |
eval temp_var=\$$1 | |
if [ -z "${temp_var}" ]; then |
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 sys | |
def create_map(filename): | |
f = open(filename, "r") | |
lines = f.readlines() | |
rows = int(lines[0].split()[0]) | |
cols = int(lines[0].split()[1]) | |
skimap = [[int(c) for c in lines[i].split()] for i in range(1,len(lines))] |