Skip to content

Instantly share code, notes, and snippets.

View maxmarkus's full-sized avatar

Markus Edenhauser maxmarkus

  • Kitzbühel/Tyrol & Munich
  • 23:26 (UTC +02:00)
View GitHub Profile
@maxmarkus
maxmarkus / ifpagewildcard.js
Created June 18, 2020 09:03
Foundation panini helper which extends ifpage with possibility to use wildcards. Extension to panini, the slim flat file generator. https://github.com/foundation/panini
module.exports = function() {
/**
* Handlebars block helper that renders the content inside of it based on the current page.
* @param {string...} pages - One or more pages to check.
* @param (object) options - Handlebars object.
* @example
* {{#ifpage 'index' 'about'}}This must be the index or about page.{{/ifpage}}
* {{#ifpage 'about*' '*ends' '*ind*ex*'}}This must be the index or about page.{{/ifpage}}
*
{{#ifpagewildcard 'over*view'}}<p>over*view</p>{{/ifpagewildcard}}
@maxmarkus
maxmarkus / connected.sh
Created January 29, 2018 15:21
Tunnelblick route traffic based on urls and domains
#!/bin/sh
# Tunnelblick route traffic based on urls and domains
# Configuration at the end of this file:
# 1. Specify tunnel interface
# 2. Enter url/domain which is used to gather IP addresses
# Copy this file to (sudo):
# cd ~/Library/Application\ Support/Tunnelblick/Configurations/{NAME}/Contents/Resources
@maxmarkus
maxmarkus / jenkins-display-errors-in-console.user.js
Last active February 2, 2018 07:53
Displays errors on top of the console page of a failed job.
// ==UserScript==
// @name Jenkins show deployment errors
// @namespace https://jenkins
// @version 0.2
// @description Displays errors on top of the console page of a failed job.
// @author Markus Edenhauser
// @include /^https://jenkins*/
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@maxmarkus
maxmarkus / sample-data-one-to-many.sql
Created May 23, 2017 17:22
Sample data for user/userdetails + n devices/devicedetails
-- DROP all data tables
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS userdetails;
DROP TABLE IF EXISTS devices;
DROP TABLE IF EXISTS devicesdetails;
-- USERS and USER DETAILS
CREATE TABLE users
(`row_id` int, `id` int, `owner_id` int, `name` varchar(55))
;
@maxmarkus
maxmarkus / jenkins-kill-jobs.user.js
Last active February 19, 2018 15:02
Adds links to Queue and Jobs for killing all of them. Be aware - as soon as you click the links, all currently shown jobs or queues will be cancelled without asking.
// ==UserScript==
// @name Jenkins kill BuildQueue + Jobs
// @namespace https://jenkins
// @version 0.32
// @description Adds a link to Queue and Jobs for killing all of them.
// @author Markus Edenhauser
// @include /^https://jenkins*/
// @exclude *configure
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
@maxmarkus
maxmarkus / jenkins-kill-jobs.user.js
Created February 23, 2017 06:31
Adds a link to Queue and Jobs for killing all of them. Be aware - as soon as you click the links, all currently shown jobs or queues will be cancelled without asking.
// ==UserScript==
// @name Jenkins kill BuildQueue + Jobs
// @namespace http://jenkins
// @version 0.1
// @description try to take over the world!
// @author Markus
// @match https://jenkins.prod.sevenup.ycd.ydev.hybris.com:10000/*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@maxmarkus
maxmarkus / pre-commit-hook-merge-conflicts.sh
Created March 24, 2016 13:26
Git pre-commit hook to prevent checking in non-resolved merge conflicts.
#!/bin/bash
# Check for merge conflicts
# Tested on Linux and Mac
# Simple check for merge conflics
conflicts=`git diff --cached --name-only -G"<<<<<|=====|>>>>>"`
@maxmarkus
maxmarkus / clickElementInDropdown.js
Created February 2, 2016 13:07
nightwatch command for gracefully clicking an element within a parent
'use strict';
/**
* clicks on an element found in a parent container
*
* @param {string} dropdownSelector mostly dropdown, but can be also other list or container
* @param {string} elementSelector element selector to click on
* @param {boolean} graceful if elementSelector is not present, either continue (true), or throw an error (false)
* @param {boolean} maxTimeout timeout to wait for element
* @return {mixed} graceful = true: continues, graceful = false: throws error