Skip to content

Instantly share code, notes, and snippets.

Avatar

Frédéric Bolvin Fensterbank

View GitHub Profile
@Fensterbank
Fensterbank / qrcode-with-logo.js
Created Apr 30, 2021
Generate qr code with company logo in the middle
View qrcode-with-logo.js
const QRCode = require('qrcode');
const sharp = require('sharp');
const { v4: uuidv4 } = require('uuid');
/* entity is the object containing the company logo, url is the url the QR code points to */
const entity = {
logo: { url: '...' }
}
const url = 'https://company.tld'
@Fensterbank
Fensterbank / blaettle_loader.rb
Last active Dec 9, 2016
Downloads the newest edition of the parish newsletter 's Blättle from the city of Metzingen
View blaettle_loader.rb
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
require 'date'
puts "#{DateTime.now.strftime("%F %T")} 's Blättle Downloader 1.0.0"
doc = Nokogiri::HTML(open('https://www.metzingen.de/de/Stadt+B%C3%BCrger/Aktuelles/Mitteilungsblatt'))
doc.css('.multiList li:first a').each do |link|
puts "#{DateTime.now.strftime("%F %T")} Aktueller Eintrag ist #{link.attributes['title'].value}"
target_filepath = "ausgaben/#{link.content.gsub(/'s/, 's')}.pdf"
@Fensterbank
Fensterbank / random-nextcloud-user.sh
Created Dec 7, 2016
Creates random nextcloud users by using RandomAPI and nextclouds provisioning API
View random-nextcloud-user.sh
#!/bin/bash
for person in `curl "https://randomuser.me/api/?format=csv&nat=de&inc=name&results=2000" -s -X GET`; do
IFS=',' read -r -a array <<< "$person"
if [ ${array[1]} != "name.first" ]; then
echo "Create ${array[1]} ${array[2]}"
curl "https://adminuser:password@domain.tld/ocs/v1.php/cloud/users" -X POST -s -d userid="${array[1]} ${array[2]}" -d password="password1433"
fi
done