Skip to content

Instantly share code, notes, and snippets.

@esposito
esposito / gist:0e7b409dedfc3344502c760a9b1c3b07
Created January 7, 2025 08:04
Twinfield 130_3 definition
<browse result="1">
<office name="Slim met Energie B.V. (nieuw)" shortname="Slim met Energie BV">230401</office>
<code>130_3</code>
<name>Debiteuren (v3)</name>
<shortname>Debiteuren (v3)</shortname>
<visible>false</visible>
<columns code="130_3">
<column id="1">
<field>fin.trs.head.office</field>
<label>Administratie</label>
@esposito
esposito / gist:a6cef16af07ff082b5430140c3c4a77b
Last active May 10, 2024 13:44
Create AWS lambda ruby layer with aws-sdk
LAYER_NAME="ruby-gems-layer"
mkdir $LAYER_NAME && cd $_
bundle init
bundle add pg --skip-install
rm Gemfile.lock
docker run --rm -v $PWD:/var/layer \
-w /var/layer \
public.ecr.aws/sam/build-ruby3.3:1.116.0-20240430173312 \
@esposito
esposito / gist:afe1b3de7b2fc427c00b7301a955e53f
Created May 8, 2024 08:56
Translate html template with Deepl
translation = DeepL.translate(
text.gsub(/^subject: /, "<lsubject />")
.gsub(/\{\{(.+?)\}\}/, '<lv>\1</lv>')
.gsub(/\{%(.+?)%\}/, '<lc>\1</lc>')
.gsub(/\{%(.+?)-%\}/, '<lcw>\1</lcw>'),
"EN", "PL", tag_handling: "xml", ignore_tags: ["lsubject", "lv", "lc", "lcw", "style"], formality: "more"
)
translation.text.gsub(%r{<lsubject />}, "subject: ")
.gsub(%r{<lv>(.+?)</lv>}, '{{\1}}')
.gsub(%r{<lc>(.+?)</lc>}, '{%\1%}')