Skip to content

Instantly share code, notes, and snippets.

@chubei
chubei / hello.py
Created July 19, 2023 05:12
Python import code example
from sqlite_utils import list_db
def hello():
list_db()
return 'Hello, World!'
@chubei
chubei / DOZER_CLA
Last active April 24, 2023 02:52 — forked from CLAassistant/SAP_CLA
Dozer Individual Contributor License Agreement
### Dozer Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by Dozer Data Pte Ltd or its affiliates (“Dozer”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Dozer in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact hello@getdozer.io.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to Dozer a non-exclusive, perpetual, i
use std::{
collections::HashMap,
env::args,
fs::File,
io::{BufRead, BufReader},
path::PathBuf,
};
fn main() {
let mut args = args();
@chubei
chubei / downloader.py
Created July 8, 2022 08:48
Download Dave and Ava videos
from pathlib import Path
from pytube.helpers import safe_filename
from pytube import Channel
from pytube.exceptions import LiveStreamError
output_folder = Path(__file__).parent / 'DaveAndAva'
output_folder.mkdir(exist_ok=True)
channel = Channel('https://www.youtube.com/c/DaveAndAva')
def calc_pelvis_bend(left_hip, right_hip, left_shoulder, right_shoulder):
print(left_hip, right_hip)
hip_center = (np.array(left_hip) + np.array(right_hip)) * 0.5 # This should be about (0, 0, 0).
shoulder_center = (np.array(left_shoulder) + np.array(right_shoulder)) * 0.5
chest_direction = shoulder_center - hip_center
chest_direction /= np.linalg.norm(chest_direction)
angle = np.arccos(-chest_direction[1])
if chest_direction[2] > 0: