Skip to content

Instantly share code, notes, and snippets.

View canyone2015's full-sized avatar

Canyon E canyone2015

View GitHub Profile
def convert_base(number: int | str, from_base: int, to_base: int):
number = int(str(number), from_base)
r = []
while number > 0:
module = number % to_base
number = number // to_base
r.append(module)
return r[::-1] or [0]
@canyone2015
canyone2015 / mixkit_video_list.json
Last active March 2, 2025 06:56
Mixkit Video list (last 16160 videos)
This file has been truncated, but you can view the full file.
{
"items": [
{
"title": "Macaw parrot feeding on a branch",
"description": "Macaw parrot of red, blue and green colors, feeding on a tree branch, in captivity on a sunny day.",
"url": "https://mixkit.co/free-stock-video/macaw-parrot-feeding-on-a-branch-4669/",
"tags": [
"Animal",
"Bird",
"Branch",
@canyone2015
canyone2015 / mixkit_sfx_list.json
Last active March 2, 2025 06:44
Mixkit SFX / special sound effects list
{
"items": [
{
"title": "Little birds singing in the trees",
"tags": [
"Animals",
"Bird",
"Forest",
"Morning"
],
@canyone2015
canyone2015 / merriam_webster_pro.json
Created February 24, 2025 05:05
Merriam-Webster "Oxford 3000 and 5000": part of speech, definition, example, synonyms, antonyms, similar words [pro-version: 39015 words, 4035 words with definition, 11207 definitions, 11166 synonyms, 8395 antonyms, 36162 similar words]
This file has been truncated, but you can view the full file.
{
"abandon": [
["verb", "to give (oneself) over to something especially unrestrainedly", "More than ready to abandon himself to a life of complete idleness for the duration of his vacation", ["indulge", "surrender"], ["deny", "forego"], ["bask", "deliver", "give up", "luxuriate", "overdo", "overindulge", "revel", "roll", "wallow", "yield"]],
["verb", "to cause to remain behind", "Abandoned the group that he had been hiking with and struck out on his own", ["forsake", "leave"], ["have", "hold", "keep", "own", "possess", "reclaim", "retain", "withhold"], ["abjure", "cut off", "deliver", "desert", "discard", "disown", "disregard", "ditch", "dump", "escape", "fling", "forget", "give up", "hand over", "ignore", "jettison", "junk", "maroon", "neglect", "quit", "reject", "relinquish", "renounce", "repudiate", "retreat (from)", "sacrifice", "scrap", "separate (from)", "shed", "shuck (off)", "strand", "surrender", "take off (from)", "throw away", "throw out", "vacate", "walk away from", "walk out o
@canyone2015
canyone2015 / merriam_webster_mini.json
Created February 24, 2025 05:04
Merriam-Webster "Oxford 3000 and 5000": part of speech, definition, example, synonyms, antonyms, similar words [mini-version: 3992 words, 10815 definitions, 3521 synonyms, 1896 antonyms, 3618 similar words]
This file has been truncated, but you can view the full file.
{
"abandon": [
["verb", "to give (oneself) over to something especially unrestrainedly", "More than ready to abandon himself to a life of complete idleness for the duration of his vacation", ["indulge"], ["deny"], ["deliver"]],
["verb", "to cause to remain behind", "Abandoned the group that he had been hiking with and struck out on his own", ["leave"], ["hold", "keep", "own", "possess", "retain"], ["deliver", "desert", "discard", "dump", "escape", "forget", "ignore", "neglect", "reject", "sacrifice", "shed", "strand"]],
["verb", "to put an end to (something planned or previously agreed to)", "The bad weather forced NASA to abandon the launch", ["cancel"], ["continue", "keep"], ["end", "halt", "interrupt", "recall", "reverse", "suspend", "terminate", "withdraw"]],
["verb", "to stop doing (something) permanently", "Marriage customs that were abandoned decades ago", [], ["continue", "keep", "maintain"], ["cease", "conclude", "end", "expire", "halt", "pause", "terminate"]],
@canyone2015
canyone2015 / auto_crop_and_resize_images.py
Last active June 6, 2025 08:35
Auto crop and resize images
import glob
import os
import numpy as np
from PIL import Image
def crop_image(img):
mask = img < 230
mask = mask.any(2)
@canyone2015
canyone2015 / wordsmyth_mini.json
Created February 11, 2025 14:32
Wordsmyth "Oxford 3000 and 5000": part of speech, definition, example, synonyms, antonyms, similar words [mini-version: 3061 words, 10939 definitions, 2693 synonyms, 1121 antonyms, 2866 similar words]
This file has been truncated, but you can view the full file.
{
"abandon": [
["transitive verb", "to leave (someone or something) with no intention of returning or taking up possession again", "They abandoned the old car in the ditch", ["desert", "reject"], ["keep", "retain"], ["drop", "leave"]],
["transitive verb", "to give up (a structure or place) by withdrawing from it", "The captain gave the order to abandon the ship", [], [], ["surrender"]],
["transitive verb", "to allow (oneself) to be taken over completely by emotions or impulses", "As the fire approached, many abandoned themselves to hysteria", ["surrender"], ["compose"], []],
["noun", "freedom from restraint or inhibition", "He rode the horse with reckless abandon", ["freedom"], ["restraint"], ["enthusiasm"]],
["noun", "a state in which emotions or impulses control one completely", "She shrieked and waved her arms in abandon", ["surrender"], [], []]
],
"ability": [
["noun", "the capacity or power to do something; quality of being able", "Most birds ha
@canyone2015
canyone2015 / wordsmyth_pro.json
Created February 11, 2025 14:31
Wordsmyth "Oxford 3000 and 5000": part of speech, definition, example, synonyms, antonyms, similar words [pro-version: 17868 words, 3228 words with definition, 12168 definitions, 10303 synonyms, 3447 antonyms, 14651 similar words]
This file has been truncated, but you can view the full file.
{
"abandon": [
["transitive verb", "to leave (someone or something) with no intention of returning or taking up possession again", "They abandoned the old car in the ditch", ["desert", "forsake", "reject", "turn one's back on"], ["keep", "re-claim", "retain"], ["drop", "jettison", "leave", "maroon", "repudiate"]],
["transitive verb", "to give up (a structure or place) by withdrawing from it", "The captain gave the order to abandon the ship", ["forsake"], ["re-claim"], ["give up", "relinquish", "scuttle", "surrender", "turn one's back on"]],
["transitive verb", "to stop pursuing (an activity, goal, or the like); give up; relinquish", "He abandoned his dream of becoming an actor", ["forsake", "give up", "relinquish"], [], ["renounce"]],
["transitive verb", "to allow (oneself) to be taken over completely by emotions or impulses", "As the fire approached, many abandoned themselves to hysteria", ["surrender"], ["compose", "recompose"], []],
["noun", "freedom from restrai
@canyone2015
canyone2015 / ssh_example.py
Created February 11, 2025 14:12
SSH in Python example
import os
import paramiko
HOST = 'hostname'
USER = 'root'
PORT = 22
PASSWORD = 'password'
COMMANDS = r"""
cd /root/tmp_dir
source venv/bin/activate
@canyone2015
canyone2015 / auto_cut_mp3.py
Created February 11, 2025 14:09
Auto cut mp3 file
import traceback
import librosa.feature
import soundfile as sf
def auto_cut_mp3_file(src_filepath: str,
dest_filepath: str,
duration_in_seconds: float,
sample_rate: int = 22050,