View sync_credentials.sh
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
readonly gopass_prefix="" | |
generate_empty_store() { | |
local target_file="$1" | |
local master_password="" | |
{ |
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'; |
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' \ |
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 }}' |
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 |
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'; |
View install.txt
npm install selenium-webdriver | |
npm install selenium-server-standalone-jar | |
npm install phantomjs |
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 |
NewerOlder