Skip to content

Instantly share code, notes, and snippets.

View vitalfadeev's full-sized avatar

Vital Fadeev vitalfadeev

  • Russia
View GitHub Profile
@vitalfadeev
vitalfadeev / D dub vf.sublime-build
Last active March 14, 2026 16:06
Sublime 4 D lang build with dub, or with dub ldc2
{
"shell_cmd": "dub build",
"file_regex": "^(.*?)\\(([0-9]+)(,[0-9]+)?\\)",
"working_dir": "${folder:${project_path:${file_path}}}",
"selector": "source.d",
"syntax": "Packages/D/DMD Output.sublime-syntax",
"keyfiles": ["dub.sdl", "dub.json"],
"variants":
[
{
ciadpi-x86_64 --tlsrec 3+s --auto=torst --timeout 3
@vitalfadeev
vitalfadeev / convert-to-_-mp4.sh
Created March 2, 2025 08:14
Convert video to small size
#!/bin/sh
# Usage: convert-to-_-mp4.sh 320 28 $1
#SIZE=480
#QUAL=28
#NAME=MOVA0023.avi
SIZE=$1
QUAL=$2 # 18..28 18-best 28-small
NAME=$3
@vitalfadeev
vitalfadeev / mount-zips.sh
Created November 4, 2024 09:34
Mount *.zip to *.mnt in current folder usin FUSE. View zip images on-fly.
#!/bin/bash
# Mount *.zip to *.mnt in current folder
echo_color() {
local color=$1
local text=$2
echo -e -n "\e[${color}m${text}\e[0m"
}
echo_green() {
@vitalfadeev
vitalfadeev / to-github.sh
Last active November 8, 2023 06:48
Create new repo on github.com from local folder and upload.
#!/bin/sh
# gh auth login
git init
git add -A .
git commit -m "First commit"
NAME=`basename $PWD`
gh repo create "${NAME}" --source=. --public --push
@vitalfadeev
vitalfadeev / Makefile
Last active November 15, 2022 10:07
Create disk image with GRUB2 installd
# Create disk image with GRUB2 installd
# Requires: grub-install rm mkdir dd parted kpartx mkfs.vfat mkfs.ext2 cp mount umount chown
# Source tree:
# img/
# ext2 fat16 fat32
FS=ext2
#
DISK_FILE=disk.img
DISK_SIZE=20
BUILD_FOLDER=.build
#!/bin/sh
# clear system journal (gnome journald)
sudo journalctl --rotate
sudo journalctl --vacuum-size=100M
sudo journalctl --vacuum-time=1s
sudo systemctl restart systemd-journald
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
#!/bin/bash
# Remove start into from video.
# Remove end titres from video.
[ -e splitted ] || mkdir trimed
for f in *.mp4
do
echo $f
ffmpeg \
@vitalfadeev
vitalfadeev / TrueType.ts
Created September 14, 2020 11:28 — forked from smhanov/OpenType.ts
Here is my implementation of a TrueType font reader in Typescript. You can read a font directly from an ArrayBuffer, and then call drawText() to draw it. See my article http://stevehanov.ca/blog/index.php?id=143
// By Steve Hanov
// steve.hanov@gmail.com
// Released to the public domain on April 18, 2020
//import { log } from "./log"
// Usage:
/*
declare let arrayBuffer:ArrayBuffer;