Skip to content

Instantly share code, notes, and snippets.

View fdamken's full-sized avatar
🧐
Playing np.reshape(…).

Fabian Damken fdamken

🧐
Playing np.reshape(…).
View GitHub Profile
@fdamken
fdamken / SkipAd.user.js
Last active June 14, 2024 10:06
TamperMonkey Script for Skipping YouTube Ads
// ==UserScript==
// @name SkipAd
// @namespace http://tampermonkey.net/
// @version 1.0.1
// @description Skips ads as soon as possible and closes popup ads.
// @author Fabian Damken
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@fdamken
fdamken / BigBlueButtonAutoLowerHand.js
Created December 2, 2022 17:53
TamperMonkey script for lowering your hand in BigBlueButton
// ==UserScript==
// @name BigBlueButtonAutoLowerHand
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description Lowers your hand as soon as you unmute your microphone.
// @author Fabian Damken
// @match https://bbb.fachschaft.informatik.tu-darmstadt.de/*
// @grant none
// ==/UserScript==
@fdamken
fdamken / neural-network.tex
Last active November 9, 2020 21:01
This small LaTeX/TikZ script generates neural network images with arbitrary input, output and hidden layer size and depth. Also a reasonable bounding box is set automatically. You might want to change the colors TUDa-{4a,1a,6a} to something other.
% #1 := Optional TikZ style arguments.
% #2 := Number of input neurons.
% #3 := Number of hidden neurons.
% #4 := Number of output neurons.
% #5 := Number of hidden layers plus one.
\newcommand{\tikzNeuralNetwork}[5][]{
\begin{scope}[
input neuron/.style = { draw, circle, minimum width = 0.2cm, minimum height = 0.2cm, fill = TUDa-4a },
neuron/.style = { draw, circle, minimum width = 0.2cm, minimum height = 0.2cm, fill = TUDa-1a },
output neuron/.style = { draw, circle, minimum width = 0.2cm, minimum height = 0.2cm, fill = TUDa-6a },
@fdamken
fdamken / download-all-tb-scalars.sh
Created April 16, 2020 09:34
Small BASH script to download all scalar metrics from a TensorBoard instance.
#!/usr/bin/env bash
format="$1"
base_url="$2"
set -o errexit
set -o nounset
if [[ "$format" == "" ]]; then
@fdamken
fdamken / default.conf
Last active September 29, 2019 12:45
Nginx for Future Configuration; Redirects all traffic of your nginx server to another domain on Fridays between 10:00 and 16:00 (server time).
server {
# Nginx for Future!
# Can be replaced with other domains, e.g. https://fridaysforfuture.org or similar.
location / {
rewrite_by_lua '
local current_date = os.date("*t")
if current_date.wday == 6 then
local current_time = os.time()
local start_time = os.time({ year = current_date.year, month = current_date.month, day = current_date.day, hour = 10, min = 0, sec = 0 })
local end_time = os.time({ year = current_date.year, month = current_date.month, day = current_date.day, hour = 16, min = 0, sec = 0 })
@fdamken
fdamken / obj-to-xml.js
Created July 20, 2016 17:03
A simple script to convert JavaScript objects into XML (SOAP).
var lodash= require('lodash');
module.exports = function(obj) {
let result = '';
for (var key in obj) {
let value = obj[key];
let attributes = '';
for (let attributeKey in (value.attributes || { })) {
attributes += ` ${attributeKey}="${lodash.escape(value.attributes[attributeKey])}"`;
@fdamken
fdamken / add-strict.sh
Last active June 29, 2016 14:39
Enables the strict mode for every JavaScript file (*.js) in the current directory (recursively).
#!/bin/bash
for file in $(find . -type f -name '*.js' -print -exec head -n 1 {} \; | awk \
'BEGIN {
prev = "";
}
{
if (prev == "") {
prev = $0;
} else {