Skip to content

Instantly share code, notes, and snippets.

View dkruythoff's full-sized avatar

Darius Kruythoff dkruythoff

View GitHub Profile
@dkruythoff
dkruythoff / rss2html.js
Last active January 26, 2024 13:36
function to convert a RSS feed to HTML
async function rss2html(url) {
const rssResponse = await fetch(url);
const rssText = await rssResponse.text();
const parser = new DOMParser();
const doc = parser.parseFromString(rssText, "application/xml");
const channel = doc.querySelector("channel");
const title = channel.querySelector("title").textContent;
const link = channel.querySelector("link").textContent;
const items = Array.from(channel.querySelectorAll("item")).map((item) => ({
title: item.querySelector("title").textContent,
[{"name":"Frans","parts":[{"name":"hoofdstuk 1.1","tests":[{"question":"la France","answer":"Frankrijk"},{"question":"un pays","answer":"een land"},{"question":"une ville","answer":"een stad"},{"question":"un village","answer":"een dorp"},{"question":"le train","answer":"de trein"},{"question":"de ","answer":"van"},{"question":"à","answer":"naar"},{"question":"une auto","answer":"een auto"},{"question":"l'autoroute (vrouwelijk)","answer":"de snelweg"},{"question":"la maison de vacances","answer":"het vakantiehuis"}]},{"name":"Hoofdstuk 5.1","tests":[{"question":"le frère","answer":"de broer"},{"question":"le grand-père","answer":"de opa"},{"question":"la grand-mère","answer":"de oma"},{"question":"la tante","answer":"de tante"},{"question":"l’oncle","answer":"de oom"},{"question":"le cousin","answer":"de neef (zoon van oom/tante)"},{"question":"la cousine","answer":"de nicht (dochter van oom/tante)"},{"question":"le neveu","answer":"het neefje (zoon van broer/zus)"},{"question":"la nièce","answer":"het nicht
@dkruythoff
dkruythoff / commit-msg
Created January 11, 2017 10:29 — forked from boschni/commit-msg
Git commit hook to automatically add branch name to every commit message. Put in ".git/hooks/commit-msg" and give the file execute rights.
#!/bin/sh
#
# Automatically adds branch name to every commit message.
#
NAME=$(git branch | grep '*' | sed 's/* //')
if [ -n "$NAME" ]
then
if [ "$NAME" = "master" ]
then
echo $(cat "$1") > "$1"