Skip to content

Instantly share code, notes, and snippets.

View mluerig's full-sized avatar

Moritz Lürig mluerig

View GitHub Profile
@mluerig
mluerig / qr_tags.py
Last active April 21, 2023 15:09
make QR code and number
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 21 17:08:35 2023
@author: mluerig
"""
#%% imports
import os
@mluerig
mluerig / git-mod-date.js
Last active January 19, 2022 15:44
getting the latest mod date-time for websites
repo_api_link = "https://api.github.com/repos/phenopype/phenopype-lander/commits";
function ModifiedDateTime() {
fetch(repo_api_link).then((response) => {
return response.json();
})
.then((commits) => {
var dat = commits[0]['commit']['committer']['date'];
document.getElementById('last-modified-datetime').textContent = dat.slice(0,10) + " " + dat.slice(11,19) ;
});
@mluerig
mluerig / paperpile_crawler.py
Created January 13, 2020 09:47
paperpile shared folder download pdf crawler
# this is not a standalone script, i.e. needs to be run from some IDE
import os
from bs4 import BeautifulSoup
import re
shared_folder_url = "" # your shared folder url
save_dir = "D:\\Temp\\pdfs"
all_urls = []
for page in ["","/2", "/3", "/4"]: # if you have multiple pages
@mluerig
mluerig / citation_finder.py
Created October 30, 2018 17:35
this finds citations in text-files based on the pattern "four digits inside parentheses". outputs textfile with list
import os
import re
os.chdir("E:\\PhD\\Chapters\\2_Sondes_2015")
file = open(os.path.join(os.getcwd(),"sondes_manuscript.txt"), encoding="utf8")
findings = []
for line in file:
import argparse
import os
import subprocess
import sys
from wand.image import Color, Image, COMPOSITE_OPERATORS
from wand.drawing import Drawing
from wand.display import display