Skip to content

Instantly share code, notes, and snippets.

@wincentbalin
wincentbalin / compile-gcr-tools.sh
Last active May 13, 2018
How to compile gcrtraining tools for win32
View compile-gcr-tools.sh
# Install pre-requisites (pango is needed for xheights)
sudo apt install build-essential libpango1.0-dev
# Clone gcrtraining repository
git clone https://ancientgreekocr.org/grctraining.git
# Compile LibUTF
cd grctraining/tools/libutf
make CFLAGS="-ansi -pedantic -O2 -Wall -Wextra"
cd ..
@wincentbalin
wincentbalin / qt-box-editor-compile.sh
Last active Mar 20, 2018
Attempt to compile static binaries for qt-box-editor using MXE
View qt-box-editor-compile.sh
#!/bin/sh
#
# Compile qt-box-editor for win32
# Set amount of MXE parallel compiling jobs
if [ "$JOBS" = "" ]
then
JOBS=1
export JOBS
fi
@wincentbalin
wincentbalin / .dockerignore
Created Mar 17, 2018
Attempt to compile static binaries for qt-box-editor
View .dockerignore
README.md
compile_qt-box-editor.sh
qt-box-editor-win32.zip
@wincentbalin
wincentbalin / remove_unused_images.sh
Created Feb 27, 2018
Remove unused Docker images
View remove_unused_images.sh
#!/bin/sh
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")
@wincentbalin
wincentbalin / remove_stopped_containers.sh
Created Feb 27, 2018
Remove stopped Docker containers
View remove_stopped_containers.sh
#!/bin/sh
docker rm $(docker ps -a -q)
@wincentbalin
wincentbalin / create-calendar.sh
Last active Jan 3, 2018
Create calendar form on a A4 page
View create-calendar.sh
#!/bin/sh
pcal -o june.ps -P a4 -M -F 1 -E 01 2018
ps2pdf june.ps
@wincentbalin
wincentbalin / main.cpp
Created Dec 22, 2017
Get SQLite compile_options from Qt SQLite
View main.cpp
#include <QCoreApplication>
#include <QTextStream>
#include <QSqlDatabase>
#include <QSqlQuery>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QTextStream out(stdout);
QTextStream err(stderr);
@wincentbalin
wincentbalin / idle.bat
Created Dec 15, 2017
Run IDLE from a batch file
View idle.bat
@echo off
if "%1" == "" goto start_without_arguments
:start_with_arguments
start /B python -m idlelib.idle %1 %2 %3 %4 %5 %6 %7 %8 %9
exit /B
:start_without_arguments
python -m idlelib.idle
@wincentbalin
wincentbalin / videocutter.py
Last active Nov 1, 2017
How to cut videos automatically using FFMPEG
View videocutter.py
#!/usr/bin/env python
"""
Cut videos specified in the description file using FFMPEG.
"""
import os
import sys
import subprocess
import argparse
@wincentbalin
wincentbalin / command.js
Created Oct 28, 2017
Dump innerHTML at Firefox console
View command.js
$x('//div[@class="content"]').forEach(function(el) { console.log(el.innerHTML); console.log('----'); })