Skip to content

Instantly share code, notes, and snippets.

View berteh's full-sized avatar

Berteh berteh

View GitHub Profile
@berteh
berteh / boiteachansons-beautify.user.js
Last active November 26, 2023 20:35
beautify boiteachansons.net
View boiteachansons-beautify.user.js
// ==UserScript==
// @name Boite a Chansons beautify, great to print/export songsbooks with chords.
// @version 1.1
// @match https://www.boiteachansons.net/*
// @icon https://www.boiteachansons.net/favicon-32x32.png
// @downloadURL https://gist.github.com/berteh/88cfaaf4ca7e34b77cd7e91624fc12bc/raw/boiteachansons-beautify.user.js
// @grant none
// ==/UserScript==
const css = `
@berteh
berteh / ultimate-guitar-download.user.js
Last active November 26, 2023 20:38
download tabs/chords from ultimate-guitar.com song as a text file, simply hit CTRL+ALT+D after page is loaded.
View ultimate-guitar-download.user.js
// ==UserScript==
// @name download Ultimate Guitar tabs-chords
// @description hit CTRL+ALT+D after whole page is loaded to download tabs/chords of current page as a text file.
// @version 1.1
// @icon https://tabs.ultimate-guitar.com/static/public/img/product_icons/ug/favicon.ico
// @require http://code.jquery.com/jquery-latest.js
// @run-at document-end
// @downloadURL https://gist.github.com/berteh/8c052685905f58b64ccc44f272273506/raw/ultimate-guitar-download.user.js
// @match https://tabs.ultimate-guitar.com/*
// ==/UserScript==
@berteh
berteh / README.md
Last active August 18, 2023 13:30
generate (html) labels from excel data, ready for Zebra printer
View README.md
@berteh
berteh / litefarm-useability.user.js
Last active November 26, 2023 20:39
small improvements to litefarm online app
View litefarm-useability.user.js
// ==UserScript==
// @name LiteFarm customisation
// @namespace https://app.litefarm.org/
// @version 0.2
// @description small hacks to improve litefarm useability
// @author Berteh
// @match https://app.litefarm.org/tasks
// @icon https://www.google.com/s2/favicons?sz=64&domain=litefarm.org
// @downloadURL https://gist.github.com/berteh/0b08376fd842cbb9e72f62ea4c89806f/raw/litefarm-useability.user.js
// @grant GM_addStyle
@berteh
berteh / list files in sharepoint subdirectory.ps1
Created August 18, 2023 13:14
PWS list files in sharepoint document repository
View list files in sharepoint subdirectory.ps1
#inspired from
# https://www.sharepointdiary.com/2018/03/sharepoint-online-get-all-documents-using-powershell.html
# https://www.sharepointdiary.com/2018/03/sharepoint-online-powershell-to-get-folder-in-document-library.html
#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
#Function to Generate Report on all documents in a SharePoint Online Site Collection
Function Get-SPODocumentInventory($SiteURL)
@berteh
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 https://organice.200ok.ch/
// @version 0.1
// @description Organice: change default font and make edit icons layout more compact
// @author berteh
// @url https://gist.github.com/berteh/
// @match https://organice.200ok.ch/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=organice.200ok.ch
// @license https://creativecommons.org/licenses/by-nc-sa/4.0/
@berteh
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 https://www.cmsimple.org/
View fr.php
<?php
/* utf8-marker = ←éèêàùûç→ */
$tx['action']['delete']="supprimer";
$tx['action']['download']="télécharger";
$tx['action']['edit']="éditer";
$tx['action']['save']="sauvegarder";
$tx['action']['upload']="télécharger";
$tx['action']['view']="voir";
$tx['adminmenu']['configuration']="CMS";
$tx['adminmenu']['downloads']="Téléchargements";
@berteh
berteh / bash_aliases_pdf.sh
Created November 13, 2015 12:44
bash shortcut (alias/functions) to turn pdf to booklet or cardset.
View bash_aliases_pdf.sh
# pdf shortcuts, using pdftk
pdfcount(){
#return number of pages of a pdf file
pdftk $1 dump_data output | grep -i NumberOfPages | grep -oE "[[:digit:]]{1,}"
}
pdf2booklet16(){
# 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
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
berteh / ArrayTranspose.pl
Created July 23, 2013 08:11
Transpose a CSV array
View ArrayTranspose.pl
#! /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"