Skip to content

Instantly share code, notes, and snippets.

Christoph Burgmer cburgmer

Block or report user

Report or block cburgmer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cburgmer
cburgmer / concourse-proxy.js
Last active May 10, 2019
Concourse CI 5 supports CC.XML. This is a proxy for unauthorised access to that new API.
View concourse-proxy.js
#!/usr/bin/env node
// Concourse CI 5 supports CC.XML
// This small program will allow unauthorised access to the new API, while we
// figure out how to get existing monitors on to OAuth and friends.
const concourseUrl = 'http://localhost:8080';
const port = 8081;
const flyTarget = 'proxy';
const flyExecutablePath = 'fly';
@cburgmer
cburgmer / rearrange_double_sided_scan.sh
Created Jan 6, 2019
Scan two sided documents with a one-side only scanner
View rearrange_double_sided_scan.sh
#!/bin/bash
readonly TMP_DIR="/tmp/rearrange_double_sided_scan.$$"
pages_rearranged() {
local dir="$1"
local count
count=$(( $(ls "$dir" | wc -l) / 2 ))
paste -d '\n' \
@cburgmer
cburgmer / example.js
Last active Nov 11, 2017
Mock Document for Google Apps Scripts, this implements a partial interface of https://developers.google.com/apps-script/reference/document/document
View example.js
var doc = fakeDocument(
aParagraph('some text'),
aBookmark('my-id')
);
doc.getBody().getNumChildren();
// => 2
doc.getBody().getChild(0).getText();
// => 'some text'
View slackbot_reminder_bitbucket_pullrequests.py
import os
import sys
import requests
import json
POST_URL = 'https://slack.com/api/chat.postMessage'
REPOSITORY_PR = 'https://{{ your corporate server }}/rest/api/1.0/projects/{{ your project }}/repos/{{ your repo }}/pull-requests?state=OPEN'
SLACK_CHANNEL = '#{{ your channel }}'
@cburgmer
cburgmer / join_junit_xml.sh
Last active Aug 29, 2015
How to join JUnit XML files when all you have is basic Unix commands
View join_junit_xml.sh
# For test cases wrapped with <testsuites>. For a single <testsuite> adapt accordingly.
find . -name "*.xml" -exec cat {} \; \
| sed "/<\?xml [^>]*\?>/d" | sed "/<\/*testsuites>/d" \
| (echo '<?xml version="1.0" encoding="UTF-8"?>' && echo '<testsuites>' && cat && echo '</testsuites>') \
> joined_xml
mv joined_xml joined.xml # Avoid the output being mixed up with the input
@cburgmer
cburgmer / gist:87f520a66f083a9deed8
Created Jan 12, 2015
CSS Critic reporter to find offending pixels
View gist:87f520a66f083a9deed8
csscritic.addReporter({
reportComparison: function (comparison) {
if (imagediff.equal(comparison.pageImage, comparison.referenceImage)) {
return;
}
var d = imagediff.diff(comparison.pageImage, comparison.referenceImage, {align: 'top'}).data;
var pixelDiff = [], i;
for (i=0; i < d.length; i += 4) {
if (d[i] !== 0 || d[i+1] !== 0 || d[i+2] !== 0 || d[i+3] !== 255) {
pixelDiff.push([d[i], d[i+1], d[i+2], d[i+3]]);
View debuggablePromises.js
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['ayepromise'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('ayepromise'));
} else {
root.ayepromise = factory(root.ayepromise);
}
}(this, function (ayepromise) {
'use strict';
@cburgmer
cburgmer / install.txt
Created Jul 11, 2014
Take a screenshot with selenium from node
View install.txt
npm install selenium-webdriver
npm install selenium-server-standalone-jar
npm install phantomjs
@cburgmer
cburgmer / ng-i18next-filter.js
Created Oct 18, 2013
Simple i18next translation filter for angular This solves async issues with the filter accessing the translation function before i18next is ready. The solution here is not optimal but clearly maps out the solution, something that https://gist.github.com/archer96/5239617 or https://github.com/archer96/ng-i18next/blob/master/src/provider.js fails …
View ng-i18next-filter.js
angular.module('myApp')
.run(['$rootScope', function ($rootScope) {
window.i18n.init(options, function () {
// When finished loading translations, trigger re-evaluation of views for translations
$rootScope.$digest();
});
}])
.filter('translate', [function(){
return function(key, params) {
// i18next needs time to initialize (loading translations). In this phase translation does not work
@cburgmer
cburgmer / tooltip-html-unsafe.html
Created Sep 30, 2013
Minimal test case for tooltip-html-unsafe issue in AngularUI Bootstrap
View tooltip-html-unsafe.html
<!DOCTYPE html>
<html ng-app="minimalTestCase">
<head>
<meta charset="UTF-8">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<!--script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap-tpls.js"></script>
<style>
div {
You can’t perform that action at this time.