Skip to content

Instantly share code, notes, and snippets.

View MBunel's full-sized avatar

Mattia Bunel MBunel

View GitHub Profile
@MBunel
MBunel / Pdal_pipeline_parallel_multiHosts.sh
Last active February 14, 2023 14:58
Example of simple parallel execution of a pdal pipeline on remote hosts with gnu parallel
parallel \
# Database of results metadata
--sqlandworker sqlite3:///out.sqlite/output \
# Url of host
--sshlogin host_1,host_2,: \
# Transfer of pdal pipeline on hosts
--tf my_pipeline_file.json \
# Transfer las files to remote hosts, return the results
--tf {} --return {.}.tif --cleanup \
# pdal command
@MBunel
MBunel / chap_vers.tex
Created September 16, 2020 22:51
A LuaLaTex command to get the version number of a chapter from a git repo
% A LuaLaTex command to get the version number of a chapter from a git repo.
% This command insert in the document the last number version from a git tag like : Chapter_1_V3
% For exemple \chapter{My nice chapter 1 \chapVers{1}} give : \section{My nice chapter 1 \texttt{V4}}
% if the git repo have a tag "Chapter_1_V4"
\newcommand\chapVers[1]{
\texttt{(\directlua{tex.print(io.popen('git describe --tags --match "*_#1_*" | grep -o
V[0-9] || echo "V0" '):read())})}
}
@MBunel
MBunel / epicene.tex
Created June 8, 2020 21:38
Exemple minimal pour l'utilisation du point médian en (Lua)LaTex
% Conçut pour LuaLaTeX.
% Le texte est en utf-8 par défaut
\documentclass[10pt]{minimal}
% Francisation du texte
\usepackage[french]{babel}
% Pour le paratexte (les […])
\usepackage{csquotes}
import Database.HDBC
import Database.HDBC.PostgreSQL
main = do
conn <- connectPostgreSQL "dbname=postgres user=postgres"
run conn "TRUNCATE test;" []
insert <- prepare conn "INSERT INTO test VALUES (?);"
executeMany insert values
commit conn
disconnect conn