Skip to content

Instantly share code, notes, and snippets.

View sevein's full-sized avatar

Jesús García Crespo sevein

View GitHub Profile
<?php
/*
* This file is part of the AccesstoMemory (AtoM) software.
*
* AccesstoMemory (AtoM) is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
data/fixtures/settings.yml | 7 +-
lib/task/migrate/arUpgradeSqlTask.class.php | 118 +++++++++++++++++++-
lib/task/migrate/arUpgrader130.class.php | 49 --------
.../migrate/migrations/arMigration0093.class.php | 50 +++++++++
.../migrate/migrations/arMigration0094.class.php | 49 ++++++++
5 files changed, 220 insertions(+), 53 deletions(-)
diff --git a/data/fixtures/settings.yml b/data/fixtures/settings.yml
index e292b26..924ac85 100644
--- a/data/fixtures/settings.yml
@sevein
sevein / fix-issue-4539.patch
Created January 17, 2013 01:20
Fix for issue #4539 for ICA-AtoM 1.3.0
diff --git a/apps/qubit/modules/user/actions/indexAction.class.php b/apps/qubit/modules/user/actions/indexAction.class.php
index 806c432..57dc69f 100644
--- a/apps/qubit/modules/user/actions/indexAction.class.php
+++ b/apps/qubit/modules/user/actions/indexAction.class.php
@@ -32,6 +32,6 @@ class UserIndexAction extends sfAction
}
}
- $this->amountOfNotes = count($this->resource->notes);
+ $this->amountOfNotes = count($this->resource->getNotes());
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
@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();
ab Abkhazian
aa Afar
af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
an Aragonese
hy Armenian
as Assamese
@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

@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:

-----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 / 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