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
apt update | |
apt install python3-bluez -y | |
git clone https://github.com/OpenWonderLabs/python-host.git | |
cd python-host | |
pip3 install setuptools==58 | |
pip3 install pybluez | |
apt install pkg-config libboost-python-dev libboost-thread-dev libbluetooth-dev libglib2.0-dev python-dev python3-dev -y |
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
#! /usr/bin/env bash | |
cd -- "$(dirname -- "${BASH_SOURCE[0]}")" | |
function exec_uncollections() { | |
ACCESS_KEY="$(security find-generic-password -a "${USER}" -s unsplash-uncollections-access-key -w)" | |
export ACCESS_KEY | |
python3 ./uncollections.py | |
} |
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
mkdir nerdctl | |
cd nerdctl | |
wget 'https://github.com/containerd/nerdctl/releases/download/v0.12.1/nerdctl-0.12.1-linux-arm-v7.tar.gz' | |
tar xzf nerdctl-0.12.1-linux-arm-v7.tar.gz | |
alias k3sctl="/root/nerdctl/nerdctl --address /run/k3s/containerd/containerd.sock --namespace k8s.io" | |
wget 'https://github.com/containernetworking/plugins/releases/download/v1.0.1/cni-plugins-linux-arm-v1.0.1.tgz' | |
mkdir -p /opt/cni/bin |
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
from deco import concurrent | |
from deco import synchronized | |
import time | |
@concurrent | |
def process(data): | |
time.sleep(1) | |
return data |
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
. |
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
from multiprocessing import Process | |
import time | |
import sys | |
def f(x): | |
if x == 3: | |
sys.exit(1) | |
time.sleep(2) | |
print('hello', x) |
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
from itertools import groupby | |
f = open("music.utf8.tsv") | |
lines = [l[:-1] for l in f] | |
data = [l.split("\t") for l in lines[1:]] | |
data = filter(lambda d: "Apple Music" in d[1], data) | |
data = filter(lambda d: d[2] != "", data) | |
for k, v in groupby(data, lambda c: c[0]): | |
album = list(v) |
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
{ | |
viewer { | |
gists(first: 100, orderBy: {field: CREATED_AT, direction: DESC}, privacy: SECRET) { | |
edges { | |
node { | |
name | |
url | |
isPublic | |
} | |
} |
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
#[derive(PartialEq)] | |
pub enum Class { | |
Var, | |
Function, | |
List, | |
Str, | |
Int, | |
Double, | |
} |
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
{ | |
"load_extensions": { | |
"nbextensions_configurator/config_menu/main": true, | |
"hinterland/hinterland": true, | |
"code_prettify/code_prettify": true, | |
"select_keymap/main": true, | |
"toc2/main": true, | |
"addbefore/main": true, | |
"autosavetime/main": true, | |
"comment-uncomment/main": true, |
NewerOlder