Skip to content

Instantly share code, notes, and snippets.


Florin Stancu niflostancu

View GitHub Profile
niflostancu /
Created January 14, 2023 12:19
Moodle submission unarchive + rename tool.
#!/usr/bin/env python3
Moodle assignment directory rename script: renames student submission
directories to the user ID / email and optionally extracts the archives inside.
Note: requires a grading CSV exported for the assignment. You need to enable it
in Assignment Settings -> Feedback Types -> Offline Grading Worksheet, then
download it from View All Submission -> Download Grading Worksheet.
Grading directories must be named as '<Full Name>_<ID>_<submission suffix>'.
niflostancu / gdocs_gradebook_helper.js
Last active November 27, 2022 20:18
Google Sheets Gradebook Tookit - contains various automation routines for gradebooks (as GApps Script).
View gdocs_gradebook_helper.js
* Google Sheets Gradebook Tookit - contains various automation routines for gradebooks.
* For now, it only facilitates anonymization of the students using public sheets.
* How to use:
* - backup your document before ;)
* - create a new Apps Script and put this code in there;
* - fill in the CONFIG structure below;
* - run + authorize the script;
niflostancu /
Created May 29, 2022 18:49
Builds a Doku wiki Table of Contents from an exported projects .csv file (for PM)
#!/usr/bin/env python3
import sys
import csv
import re
r"nume\s+prenume": "name",
r"grupa": "group",
NAMES_CSV="$(realpath "$2")"
set -e
cd "$1"
for dir in *; do
if [[ "$dir" =~ _([0-9]+)_ ]]; then
niflostancu /
Created January 4, 2017 19:55
Installing Ubuntu 16.04 on btrfs using debootstrap

Installing Ubuntu 16.04 with btrfs using debootstrap

Partition layout

First, create a GPT partition table.

  1. boot partition, label: EFI, flags: boot + ESP; size: 1GB, format to FAT32;
  2. root partition (label: root), must same size on all devices!
  3. swap partition.
niflostancu /
Created November 19, 2012 11:14
Evaluator bonus Tema 2 CPL
export CLASSPATH="$CLASSPATH:./bin:antlr-3.4.jar:java-cup-11a-runtime.jar"
PARSER="java Semant"
function fail {
printf "FAIL (%s)\n" "$1"
niflostancu / wkhtmltopdf.tablesplit.js
Last active April 17, 2022 10:07
WkHtmlToPdf Table Splitting Hack
View wkhtmltopdf.tablesplit.js
* WkHtmlToPdf table splitting hack.
* Script to automatically split multiple-pages-spanning HTML tables for PDF
* generation using webkit.
* To use, you must adjust pdfPage object's contents to reflect your PDF's
* page format.
* The tables you want to be automatically splitted when the page ends must
* have a class name of "splitForPrint" (can be changed).