Skip to content

Instantly share code, notes, and snippets.

View sevein's full-sized avatar

Jesús García Crespo sevein

View GitHub Profile
@sevein
sevein / testdata.patch
Created April 25, 2023 08:49
Testdata wrapper with mutator function
diff --git a/pkg/transfer/bag_validation_test.go b/pkg/transfer/bag_validation_test.go
index 578f0b29..8f48247e 100644
--- a/pkg/transfer/bag_validation_test.go
+++ b/pkg/transfer/bag_validation_test.go
@@ -2,20 +2,21 @@ package transfer_test
import (
"os"
+ "path/filepath"
"testing"
@sevein
sevein / 000.md
Last active February 15, 2018 18:20
Split contour and envoy into separate pods

🚧 Don't use this deployment, it is not safe! 🚧


This is an example created for projectcontour/contour#238.

It uses sevein/contour:test because #238 had not been merged by the time that this example was built.

It includes:

{
"chains": {
"01d80b27-4ad1-4bd1-8f8d-f819f18bf685": {
"description": {
"en": "Yes"
},
"link_id": "f19926dd-8fb5-4c79-8ade-c83f61f55b40"
},
"06f03bb3-121d-4c85-bec7-abbc5320a409": {
"description": {
@sevein
sevein / i18n-archivematica-workflow-index.md
Last active November 21, 2016 15:27
Internationalization of Archivematica workflow data

Internationalization of Archivematica workflow data

Redmine: https://projects.artefactual.com/issues/8161

Intro

There is a piece of work particularly challenging in the Archivematica I18N project that this document tries to break down into smaller units of work. Archivematica's workflow data is currently kept in a relational database managed by the Dashboard. It includes information about the microservices, including human-readable strings (labels) that are shown in the user interface. These strings need to be translated into other languages other than English.

The workflow data is currently considered static data not editable by the user. Keeping it in the database makes it hard to maintain (e.g. changes require database migrations) and hard to translate. This document suggests pulling this workflow data our of the database and store it in a simple JSON file - simplest way I can think of but with the goal of making much easier to introduce new way to describe our workflow rules in the future. This

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
Comment: GPGTools - https://gpgtools.org
mQINBFObJLYBEADkFW8HMjsoYRJQ4nCYC/6Eh0yLWHWfCh+/9ZSIj4w/pOe2V6V+
W6DHY3kK3a+2bxrax9EqKe7uxkSKf95gfns+I9+R+RJfRpb1qvljURr54y35IZgs
fMG22Np+TmM2RLgdFCZa18h0+RbH9i0b+ZrB9XPZmLb/h9ou7SowGqQ3wwOtT3Vy
qmif0A2GCcjFTqWW6TXaY8eZJ9BCEqW3k/0Cjw7K/mSy/utxYiUIvZNKgaG/P8U7
89QyvxeRxAf93YFAVzMXhoKxu12IuH4VnSwAfb8gQyxKRyiGOUwk0YoBPpqRnMmD
Dl7SdmY3oQHEJzBelTMjTM8AjbB9mWoPBX5G8t4u47/FZ6PgdfmRg9hsKXhkLJc7
@sevein
sevein / keybase.md
Created February 9, 2016 16:58
keybase.md

Keybase proof

I hereby claim:

  • I am sevein on github.
  • I am sevein (https://keybase.io/sevein) on keybase.
  • I have a public key ASCd7FoReOoeuZ6XlDAEbkKKc2dgJm5Pnqewzz2wfSMF-Qo

To claim this, I am signing this object:

@sevein
sevein / README.md
Last active October 9, 2022 00:24
mbox extractor

mboxext

mboxext is a Mbox mailbox message extractor.

Example

$ python mboxext.py -v /home/vagrant/Sent.mbox /home/vagrant/output/

2015-10-01 17:54:46,060 [mboxext] INFO - Target directory already exists and it's not empty

2015-10-01 17:54:46,061 [mboxext] INFO - Opening Mbox mailbox: /home/vagrant/Sent.mbox

ab Abkhazian
aa Afar
af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
an Aragonese
hy Armenian
as Assamese
@sevein
sevein / patch-settings-filter.diff
Created April 21, 2013 18:54
Simple example on how to avoid static taxonomies by caching their IDs in a cache.
diff --git a/lib/filter/QubitSettingsFilter.class.php b/lib/filter/QubitSettingsFilter.class.php
index 8894026..6e091fc 100644
--- a/lib/filter/QubitSettingsFilter.class.php
+++ b/lib/filter/QubitSettingsFilter.class.php
@@ -27,7 +27,34 @@ class QubitSettingsFilter extends sfFilter
// Overwrite/populate settings into sfConfig object
sfConfig::add(QubitSetting::getSettingsArray());
+ // Load custom taxonomies
+ $this->loadCustomTaxonomies();
import shlex
s = "name=peanut priv=with\_underscore.*:ALL"
# Ansible method
print shlex.split(s)
# Trying something different
lex = shlex.shlex(s, posix=True)
lex.whitespace_split = True