Skip to content

Instantly share code, notes, and snippets.

@santaklouse
santaklouse / CrossOver.sh
Last active November 2, 2025 20:06
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
@ESWZY
ESWZY / compress_video.py
Last active July 21, 2025 05:05
An example Python code for compressing video file to target size.
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'):
"""
Compress video file to max-supported size.
:param video_full_path: the video you want to compress.
:param size_upper_bound: Max video size in KB.
@bndeff
bndeff / usbtest.c
Last active July 7, 2021 16:10
libusb demo native app for android
#include <stdio.h>
#include <assert.h>
#include <libusb-1.0/libusb.h>
int main(int argc, char **argv) {
libusb_context *context;
libusb_device_handle *handle;
libusb_device *device;
struct libusb_device_descriptor desc;
unsigned char buffer[256];
@dgp
dgp / youtube api video category id list
Created June 11, 2015 05:57
youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs