Skip to content

Instantly share code, notes, and snippets.

View MartinLoeper's full-sized avatar
🤷‍♀️

Martin Löper MartinLoeper

🤷‍♀️
View GitHub Profile
@MartinLoeper
MartinLoeper / register-runner.sh
Last active January 25, 2022 23:23
Register multiple GitHub Runners on a machine (e.g. a raspberry pi). Call the script multiple times with increasing number.
#!/bin/bash -xe
ID=$1 # e.g. 1
TOKEN=$2 # e.g. XXXXXXXXXX
GH_USER=$3 # e.g. MartinLoeper
REPO_NAME=$4 # e.g. CS212
RUNNER_NAME=$5 # e.g. raspberrypi
REPO_URL=https://github.com/$GH_USER/$REPO_NAME
echo "Note: When asked by the installer, name your runner \$RUNNER_NAME-\$ID"
@MartinLoeper
MartinLoeper / keybase.md
Created March 23, 2021 20:06
keybase.md

Keybase proof

I hereby claim:

  • I am martinloeper on github.
  • I am martinloeper (https://keybase.io/martinloeper) on keybase.
  • I have a public key ASARwJgG8nK41--vdq7578ZdT272OEeh36xkicOFa1jdlQo

To claim this, I am signing this object:

@MartinLoeper
MartinLoeper / charts_refreshinterval_workaround.js
Last active March 3, 2021 03:03
This is a Tampermonkey script for Chrome which sets the desired refresh interval for MongoDB charts since the webapp lacks the functionality to specify it via URL parameter.
// ==UserScript==
// @name Change MongoDB Atlas Charts Public Dashboard Refresh Interval
// @namespace https://nesto-software.de/
// @version 0.1
// @description We implement a workaround for the following issue: https://feedback.mongodb.com/forums/923524-charts/suggestions/39964576-ability-to-set-refresh-rate-via-url-param
// @author Martin Löper <martin.loeper@nesto-software.de>
// @match https://charts.mongodb.com/*/public/dashboards/*
// @grant none
// @run-at document-start
// ==/UserScript==
@MartinLoeper
MartinLoeper / moment-holiday-issue.js
Last active October 3, 2018 20:56
Moment Holiday Issue
// set the context to Germany/SN
moment.modifyHolidays.set('Germany/SN');
moment('2017-11-22').isHoliday();
//Buß- und Bettag
// set the context to Canada/QC/ON
moment.modifyHolidays.set('Canada/QC/ON');
moment().holidays(['boxing', 'baptiste']);
//{ 'Boxing Day': moment("2017-12-26T00:00:00.000"),
// 'St. Jean Baptiste Day': moment("2017-06-24T00:00:00.000") }
@MartinLoeper
MartinLoeper / moment-holiday.ts
Created October 3, 2018 19:14
Moment Holiday Usage Example
import * as moment from "moment"; // moment is a peer dependency
import createMomentHolidayConfiguration from "@nesto-software/moment-holiday";
// select your country / state /region
const holidays = createMomentHolidayConfiguration("DE", "BW");
// call on the moment object directly
console.log(moment('2018-12-25').isHoliday(holidays))
// call on the moment-holiday configuration
@MartinLoeper
MartinLoeper / MyTestRule.java
Created March 12, 2018 22:13
KAMP Sample Source File
package src;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.swing.JOptionPane;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.PlatformUI;
@MartinLoeper
MartinLoeper / gist:30fac4db29815957939e95e1f7272665
Created September 1, 2017 00:49
how to fix “feature ‘xmi’ not found”
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
from https://floriansblog.wordpress.com/2015/06/11/eclipse-emf-xtext-how-to-fix-feature-xmi-not-found/