Skip to content

Instantly share code, notes, and snippets.

@sybrex
sybrex / timelapse.py
Created May 31, 2020 13:50
Generate timelapse video from images
import os
import glob
import sys
import subprocess
import shutil
TEMP_DIR = './temp'
OUTPUT = 'output.mp4'
FRAME_RATE = 10
@sybrex
sybrex / bitbucket.py
Last active June 26, 2022 12:52
Bitbucket repositories list and clone
import argparse
import json
import os
import requests
import sys
import subprocess
from requests.auth import HTTPBasicAuth
def get_reps(login: str, password: str, workspace: str) -> list:

Transforming Code into Beautiful, Idiomatic Python

When you see this, do that instead!

  • Replace traditional index manipulation with Python's core looping idioms
@sybrex
sybrex / rabbit_password_hash.php
Last active July 12, 2017 13:24
Generate RabbitMQ password hash
<?php
$salt = '908DC60A';
$password = 'secret';
$hash = base64_encode(hex2bin($salt . hash('sha256', hex2bin($salt . bin2hex($password)))));

Keybase proof

I hereby claim:

  • I am sybrex on github.
  • I am sybrex (https://keybase.io/sybrex) on keybase.
  • I have a public key ASDlBQsdtzJwtrGcpXqpP932Fk2wolDDK924D5bUXac6dgo

To claim this, I am signing this object:

@sybrex
sybrex / timelapse.sh
Last active December 28, 2015 10:49
timelapse
mkdir ordered
x=1
for i in photo2/*JPG;
do counter=$(printf %04d $x)
ln "$i" ordered1/img"$counter".jpg
x=$(($x+1))
done
#avconv -r 10 -i ordered1/img%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 -vf crop=3840:2134,scale=1920:1080 r1.mp4
#avconv -i r1.mp4 -i audio.mp3 -c:v copy -c:a copy r2.mp4
@sybrex
sybrex / .htaccess
Last active October 12, 2015 22:17
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
php_value upload_max_filesize 20M