Skip to content

Instantly share code, notes, and snippets.

@apetenchea
apetenchea / Convert .mov or .MP4 to .gif.md
Created July 17, 2025 04:36 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@apetenchea
apetenchea / building.md
Created June 16, 2025 06:57
Building rr on linux
git clone [email protected]:rr-debugger/rr.git
cd rr
find . -type f -exec dos2unix {} +
mkdir -p build
cd build
CC=clang CXX=clang++ cmake -G Ninja -Ddisable32bit=ON -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -L/home/apetenchea/scripts" -DCMAKE_BUILD_TYPE=Release ..
@apetenchea
apetenchea / test.py
Created June 1, 2025 05:44
python-arango-async pyright example
import json
import pandas as pd
import pydantic
import pydantic_core
from typing import Sequence, cast
from arangoasync.collection import StandardCollection
from arangoasync.database import StandardDatabase
from arangoasync.exceptions import DeserializationError, SerializationError
from arangoasync.serialization import Serializer, Deserializer
from arangoasync.typings import Json, Jsons
@apetenchea
apetenchea / errors.py
Created February 24, 2025 15:19
Create arango errno.py file for the python driver
import requests
ARANGODB_ERRORS_FILE = "https://raw.githubusercontent.com/arangodb/arangodb/refs/heads/devel/lib/Basics/errors.dat" # noqa: E501
def generate_section(line, output):
text = line[3:].strip()
print("#" * (len(text) + 4), file=output)
print(f"# {text} #", file=output)
print("#" * (len(text) + 4) + "\n", file=output)
@apetenchea
apetenchea / starter.ps1
Created January 25, 2025 20:52
ArangoDB starter on windows
# Check inputs
if (-not $setup) { $setup = "cluster" }
if (-not $license) { $license = "enterprise" }
if (-not $version) { $version = "3.12" }
# Determine image name
if ($license -eq "community") {
$image_name = "arangodb"
} elseif ($license -eq "enterprise") {
$image_name = "enterprise"
@apetenchea
apetenchea / manuals.py
Last active July 22, 2025 19:10
Download any manuals from https://www.manua.ls
# This script gathers all the pages of a manual and merges them into a PDF.
# You'll need to play a bit with inspect-element in order to figure out the format the correct url,
# but it should be easy to adapt it to any manual.
# This script is specifically for https://www.manua.ls/audi/q3-2018/manual.
# Their url format is https://www.manua.ls/viewer/{manual-id}/{page-number}/bg{page-number-hex}.png
# Example: https://www.manua.ls/viewer/668006/100/bg64.png
# Enjoy!
import requests
from tqdm import tqdm
from PIL import Image
@apetenchea
apetenchea / env.sh
Last active May 19, 2024 11:28
Useful ArangoDB shell functions
export ARANGODB_PATH="$HOME/arangodb"
# Continue process listening on port
function portcont() {
kill -SIGCONT $(portpid "$1")
}
# Kill process listening on port
function portkill() {
kill -9 $(portpid "$1")
@apetenchea
apetenchea / audiotext.py
Last active June 2, 2023 19:07
Text to speech in Python
# importing libraries
import pathlib
import sys
import speech_recognition as sr
import os
from pydub import AudioSegment
from pydub.silence import split_on_silence
# create a speech recognition object
r = sr.Recognizer()
@apetenchea
apetenchea / async-job.py
Last active May 19, 2023 18:37
Using async jobs in python-arango
import arango
import time
url = f"http://localhost:8530"
client = arango.ArangoClient(hosts=url)
db = client.db(name="_system")
print(db.version())
if not db.has_collection('x'):
db.create_collection('x')
@apetenchea
apetenchea / arangodb-cluster.md
Last active November 23, 2023 11:25
Starting an arangodb cluster using docker-compose

This is in response to issue #18900.
It shows how to set up an arangodb cluster with 3 agents, 2 coordinators and 3 db severs, using docker-compose. This is not the way I would set up a cluster in production, but it is ok for testing the cluster functionality. I recommend checking out the official documentation, especially Using the ArangoDB Starter.

docker-compose.yml

version: '3.7'