Skip to content

Instantly share code, notes, and snippets.

@Enweave
Enweave / get_gitlab_files.py
Created February 4, 2025 13:13
Gitlab get files by extension
import logging
import shutil
from typing import List
import requests
import os
import base64
# --- Configuration ---
GITLAB_URL = "https://gitlab.com" # Your GitLab instance URL
PRIVATE_TOKEN = "iseedeadpeople" # Your GitLab personal access token
@Enweave
Enweave / publish-to-itch.ps1
Created July 26, 2024 16:58
Godot 4 build web and publish to itch.io
# Settings -------------------------------
$BUTLER_PATH = "$ENV:AppData\itch\apps\butler\butler.exe"
$GODOT_PATH = "C:\Program Files `(`x86`)\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe"
$ITCH_USER = "JohnyDoe"
$ITCH_GAME = "PorkSouls"
$ITCH_CHANNEL = "web"
$GODOT_TEMPLATE = "`"Web`""
$EXPORT = "--export-debug" # "--export-debug" or "--export-release"
$BUILD_DIR = "build"
@Enweave
Enweave / applepay.sh
Created August 28, 2020 10:23
Create certificate processing requests(CSR) for Apple PAY under linux
# Apple Pay Merchant Identity
openssl genrsa -out identity.key 2048
openssl req -new -key identity.key -out identity.csr
# Apple Pay Payment Processing
openssl ecparam -out processing.key -name prime256v1 -genkey
openssl req -new -key processing.key -out processing.csr
@Enweave
Enweave / imgseq.sh
Last active March 31, 2020 12:42
ffmpeg create looped slideshow over a music track.
#!/bin/bash
# folder wth images
IMAGE_DIRECTORY="test_footage"
# image extension
IMAGE_EXT="jpg"
#SLIDE TIME IN SECONDS
SLIDE_DURATION=2
@Enweave
Enweave / webpush.js
Last active July 18, 2020 01:29
webpush.js
// adressing this issue https://github.com/safwanrahman/django-webpush/issues/66
function urlB64ToUint8Array(base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/');
const rawData = window.atob(base64);
const outputArray = new Uint8Array(rawData.length);
@Enweave
Enweave / stream.sh
Created July 9, 2019 17:25
ffmpeg stream rtsp to youtube via rtmp
# your youtube name/key
KEY="1234-5678-9101-1121"
# your rtsp url
RTSP="rtsp://user:[email protected]:1234/cam/etc"
# youtube rtmp url
YTUBE="rtmp://a.rtmp.youtube.com/live2"
ffmpeg \
@Enweave
Enweave / git-repo-du.sh
Created August 22, 2016 09:19
Get git repository disk usage.
git ls-files | while read file ; do du "$file" ; done | awk '{i+=$1} END {print i/1024}'
for file in $(find ./ -name "*.scss");
do n="$(echo $file | sed 's/.scss$/.sass/')";
sass-convert $file $n;
rm $file;
done