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
set -x | |
echo 'export PATH="/opt/conda/bin:$PATH"' >> ~/.bashrc | |
sudo apt-get update --fix-missing && sudo apt-get install -y wget bzip2 ca-certificates \ | |
libglib2.0-0 libxext6 libsm6 libxrender1 git | |
wget --quiet https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh -O ~/anaconda.sh && \ | |
sudo /bin/bash ~/anaconda.sh -b -p /opt/conda && \ | |
rm ~/anaconda.sh && \ | |
sudo ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ |
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 | |
cd /tmp | |
apt-get update | |
export ANACONDA_LOCATION="anaconda3" | |
export ANACONDA_FILE="Anaconda3-5.3.1-Linux-x86_64.sh" | |
export ANACONDA_URL="https://repo.anaconda.com/archive/" | |
export ANACONDA_HOME=/usr/$ANACONDA_LOCATION |
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 rbtree | |
type Node struct { | |
Color string | |
Key int | |
Value int | |
Left, Right *Node | |
P *Node | |
} |
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
#contents.ytd-rich-grid-renderer { | |
display: none !important; | |
} | |
#items.ytd-watch-next-secondary-results-renderer { | |
display: none !important; | |
} |
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 set | |
type Set interface { | |
Add(item []byte) bool | |
Remove(item []byte) bool | |
Contains(item []byte) bool | |
} |
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 set | |
type Set interface { | |
Add(item []byte) bool | |
Remove(item []byte) bool | |
Contains(item []byte) bool | |
} |
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
type node struct { | |
item []byte | |
key uint64 | |
next *node | |
} | |
func newNode(item []byte) *node { | |
key, _ := hashstructure.Hash(item, nil) | |
return &node{ | |
item: item, |
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
func (l *list) Add(item []byte) bool { | |
var pred, curr *node | |
key, _ := hashstructure.Hash(item, nil) | |
pred = l.head | |
curr = pred.next | |
for curr.key < key { | |
pred = curr | |
curr = curr.next |
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
func (l *list) Remove(item []byte) bool { | |
var pred, curr *node | |
key, _ := hashstructure.Hash(item, nil) | |
pred = l.head | |
curr = pred.next | |
for curr.key < key { | |
pred = curr | |
curr = curr.next |
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
func (l *list) Contains(item []byte) bool { | |
var pred, curr *node | |
key, _ := hashstructure.Hash(item, nil) | |
pred = l.head | |
curr = pred.next | |
for curr.key < key { | |
pred = curr | |
curr = curr.next |