Skip to content

Instantly share code, notes, and snippets.

View msoutopico's full-sized avatar

Manuel Souto Pico msoutopico

View GitHub Profile
@msoutopico
msoutopico / foobar.py
Created April 30, 2024 14:04
foobar.py
#!/usr/bin/env python3
# preconditions
# touch foo.txt
# echo "foo" > foo.txt
# python foobar.py /path/to/foo.txt # no changes
# echo "bar" > foo.txt
# python foobar.py /path/to/foo.txt # will rename foo.txt to bar.txt
import sys
@msoutopico
msoutopico / main.py
Created April 23, 2024 17:08
maven-pe-for-llms-9_session1-exercises
#!/usr/bin/env python3
# load the libraries
import openai
import sys, os
import IPython
# from langchain.llms import OpenAI
# from langchain_community.llms import OpenAI
# from langchain_openai import OpenAI
from openai import OpenAI
@msoutopico
msoutopico / check_subset.groovy
Created April 23, 2024 11:27
check_subset.groovy
/* :name = Contains Subset :description =
*
* @author: Manuel Souto Pico
* @date: 2024-03-11
* @version: 0.0.1
*
*/
import org.omegat.util.StaticUtils
@msoutopico
msoutopico / get_omt_alt_data.sh
Last active January 19, 2024 10:17
get_omt_alt_data.sh
#!/usr/bin/env bash
# steps:
# 03_VERIF_from_Ver
# 04_VERIF_rev_del
# 05_FC_IN
# 06_FC_to_VER
# 07_FC_from_VER
# 08_FC_rev_del
# 09_POST-FC_requests
@msoutopico
msoutopico / set_latest_translation.groovy
Last active December 15, 2023 10:51
set_latest_translation.groovy
/* :name = Set Latest Translations v3 :description=
*
* @author Manuel Souto Pico, Thomas Cordonnier, Kos Ivantsov
* @creation 2023.11.06: Manuel wrote first draft
* @edit 2023.11.07: Thomas added OmegaT internals
* @edit 2023.11.17: Kos added trick to avoid merge dialog
* @edit 2023.11.19: Manuel added condition to run only for certain projects on load
* @edit 2023.11.21: Manuel added check and warning if dummy file is missing
* @edit 2023.11.22: Manuel removed reload (call to reloadProjectOnetime)
* @edit 2023.11.22: Manuel added condition to discard translations in project if they are alternative
@msoutopico
msoutopico / add_file_to_batch.sh
Created October 30, 2023 23:56
add_file_to_batch.sh
#!/usr/bin/env bash
source_dir="/home/souto/Repos/ACER-PISA-2025-FT/pisa_2025ft_translation_common/source"
root="$source_dir/batch1"
config="$source_dir/files.yaml"
# cd $root
batches="$(yq -r 'keys | .[]' $config)"
@msoutopico
msoutopico / pisa-tt-handover.md
Last active April 11, 2024 08:36
PISA 2025 -- list of tech tasks

PISA 2025 -- list of tech tasks

Period: 18 December 2023 -- 7 January 2024
Backups: Gergoe, Kos, Adrien
Updates: check revisions of this document

History

Date Task Comment
@msoutopico
msoutopico / entities.json
Created October 13, 2023 08:18
entities.json
{
"Á": { "codepoints": [193], "characters": "\u00C1" },
"á": { "codepoints": [225], "characters": "\u00E1" },
"Ă": { "codepoints": [258], "characters": "\u0102" },
"ă": { "codepoints": [259], "characters": "\u0103" },
"∾": { "codepoints": [8766], "characters": "\u223E" },
"∿": { "codepoints": [8767], "characters": "\u223F" },
"∾̳": { "codepoints": [8766, 819], "characters": "\u223E\u0333" },
"Â": { "codepoints": [194], "characters": "\u00C2" },
"â": { "codepoints": [226], "characters": "\u00E2" },
@msoutopico
msoutopico / decode_entities.sh
Last active October 13, 2023 08:26
decode_entities.sh
#!/usr/bin/env bash
# cd to the folder contianing this script and entities.json, then do
# bash decode_entities.sh
# to run from anywhere, do (requires parsing argument)
# bash /path/to/decode_entities.sh --config /path/to/entities.json
repo="/home/souto/Repos/ACER-PISA-2025-FT/pisa_2025ft_translation_common_TESTS"
files="$repo/source/batch1"
@msoutopico
msoutopico / files.yml
Last active October 13, 2023 06:32
files.yml
01_COS_SCI-A_N:
- PISA_2025FT_SCI_CACERS002-DinosaurTracks.xml
- PISA_2025FT_SCI_CACERS003-TakeawayContainers.xml
- PISA_2025FT_SCI_CACERS004-DissolvingCrystals.xml
- PISA_2025FT_SCI_CACERS005-FoodChain.xml
- PISA_2025FT_SCI_CACERS007-EarthMovement.xml
- PISA_2025FT_SCI_CACERS008-Clothing.xml
- PISA_2025FT_SCI_CACERS010-SoccerBall.xml
- PISA_2025FT_SCI_CACERS011-MoonSoil.xml
- PISA_2025FT_SCI_CACERS012-SingingFish.xml