Skip to content

Instantly share code, notes, and snippets.


Berteh berteh

View GitHub Profile
berteh / organice compact look.user.js
Last active January 13, 2023 08:44
organice (OrgMode online editor): change default font and make 'edit' icons layout more compact. Install Tampermonkey extension in your browser, then
View organice compact look.user.js
// ==UserScript==
// @name Organice compact looks
// @namespace
// @version 0.1
// @description Organice: change default font and make edit icons layout more compact
// @author berteh
// @url
// @match*
// @icon
// @license
berteh / fr.php
Created September 28, 2022 19:43
CMSimple 5.8 - fr language for backend. Copy file to CMSimple_5-8/cmsimple/languages/fr.php moreover at
View fr.php
/* utf8-marker = ←éèêàùûç→ */
berteh /
Created November 13, 2015 12:44
bash shortcut (alias/functions) to turn pdf to booklet or cardset.
# pdf shortcuts, using pdftk
#return number of pages of a pdf file
pdftk $1 dump_data output | grep -i NumberOfPages | grep -oE "[[:digit:]]{1,}"
# reorder a copy of given pdf to be printed as 2 pages/side + dual, and binded in booklets of 4 sheets (16 pages).
# input.pdf must contain a multiple of 16 pages.
berteh / limesurveyMergeArrays.js
Created August 7, 2013 09:29
Merge multidimensional arrays of 2 different questions in LimeSurvey 2.00+
View limesurveyMergeArrays.js
// merges inputs of multidimensional arrays of 2 different question (same group/page) in Limesurvey. The lines must be similar.
function mergeTables(q1id, q2id, textBoxSize = 20) {
//hide second text
$('#'+q2id+' .survey-question-text').hide();
//merge tables
var t1 = $('#'+q1id+' .survey-question-answer table');
var t2 = $('#'+q2id+' .survey-question-answer table');
berteh /
Created July 23, 2013 08:11
Transpose a CSV array
#! /usr/bin/perl
# transposes input.csv to output.csv.
# eg: input.csv:
# "id","1","2"
# "A1","a","b"
# output.csv will be
# "id","A1"
# "1","a"
View csv_to_array.php
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
* Example:
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
berteh / svg-objects-export.bat
Last active May 11, 2016 02:30
Export SVG elements to other formats (png, pdf, ps, eps, svg), selecting them based on their ID with regular expressions. Useful for designing multiple icons in single file, sprite sheets, or multi-page documents with Inkscape (or another SVG editor). Easily generate low-resolution and high-resolution renders of some of the objects included in v…
View svg-objects-export.bat
:: In Windows Inkscape is shipped with a Python interpreter, you don't need to install it.
:: save both files in same directory as inkscape.exe and call
:: svg-objects-export.bat <svg-objects-export options> infiles+
@"./python/python.exe" %* -i .\