Skip to content

Instantly share code, notes, and snippets.

View ameisehaufen's full-sized avatar
🎯
Focusing

Formiko ameisehaufen

🎯
Focusing
View GitHub Profile
@ameisehaufen
ameisehaufen / generateParticipantsSignatures.tex
Created March 18, 2021 00:51
Small piece of code to generate loop in an array in latex
\usepackage{listofitems} % Para usar o array de itens
\setsepchar{\\/,/ }
\readlist{\participante}{ % Lista de participantes
% Posto Grad, Nome Completo, função relacioada ao projeto, função no setor/empresa.
Cel, Fulano \textbf{Sauro}, Gerente do \nomeProjeto, Adjunto da Divisão\\
Civil, Ciclano \textbf{Sauro}, Gerente do \nomeProjeto, Adjunto da Divisão
}
\setsepchar{,}
\newcommand{\printSignatures}[1]{%
@ameisehaufen
ameisehaufen / removeREFACEAPPWatermark.sh
Created March 18, 2021 00:45
Remove the watermark in Refaceapp Videos. You can remove zenity if you do not want graphical progress bar.
#!/usr/bin/env bash
arquivos_selecionados=( "$@" )
for filePath in "${arquivos_selecionados[@]}"; do
ffmpeg -i "$filePath" -vf "delogo=x=20:y=20:w=170:h=70" -c:a copy "nologo-$filePath" | zenity --width 500 --title "$(basename $0 .sh)" --text "Aguarde o término do processo para $filePath" --progress --pulsate --auto-close
done
@ameisehaufen
ameisehaufen / speechToText.py
Created March 18, 2021 00:43
Speech to Text script, only for small videos, using google speech recognition.
#!/usr/bin/env python3
import speech_recognition as sr
import moviepy.editor as mp
import sys
clip = mp.VideoFileClip(sys.argv[1])
clip.audio.write_audiofile(r"/tmp/converted.wav")
audio = sr.AudioFile("/tmp/converted.wav")
r = sr.Recognizer()
@ameisehaufen
ameisehaufen / renameToASCIIOnly.sh
Created March 18, 2021 00:41
Script to rename files using only ascii chars, except spaces, etc... based on ISO9660.
#!/usr/bin/env bash
arquivos_selecionados=( "$@" )
for filePath in "${arquivos_selecionados[@]}"; do
dirName=$(dirname "$filePath")
fileBaseName=$(basename "$filePath")
fileName="$(echo "$fileBaseName" | rev | cut -d '.' -f2- | rev)"
fileExt="$(echo "$fileBaseName" | rev | cut -d '.' -f1 | rev | tr '[:upper:]' '[:lower:]')"
on_Accent='öüóőúéáàűíÖÜÓŐÚÉÁÀŰÍçÇãÃõÕâÂêÊôÔªº¹²³'
offAccent='ouooueaauiOUOOUEAAUIcCaAoOaAeEoOao123'
@ameisehaufen
ameisehaufen / getPDFHighlights.groovy
Created March 18, 2021 00:38
Groovy Script to extract pdf text from highlight annotations using PDFBOX library. Useful in Freeplane scripts
//@ExecutionModes({ON_ALL_SELECTED_NODES})
// Author: Otavio Camargo @ameisehaufen
@Grab(group='org.apache.pdfbox', module='pdfbox', version='2.0.22')
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationText;
import org.apache.pdfbox.text.PDFTextStripperByArea;
@ameisehaufen
ameisehaufen / pdfboxtest.groovy
Created March 17, 2021 18:57 — forked from kimukou/pdfboxtest.groovy
pdfboxtest.groovy
//see http://www.moriwaki.net/wiki/index.php?[[PDFBox]]
//see pdfbox-1.4.0/pdfbox/src/main/java/org/apache/pdfbox/examples
@Grab(group='org.apache.pdfbox', module='pdfbox', version='1.3.1')
import org.apache.pdfbox.pdfwriter.*
import org.apache.pdfbox.pdmodel.*
import org.apache.pdfbox.pdmodel.font.*
import org.apache.pdfbox.pdmodel.edit.*
String writeFile = "d:/xxx.pdf"