Skip to content

Instantly share code, notes, and snippets.

View ingorichter's full-sized avatar

Ingo Richter ingorichter

View GitHub Profile
@ingorichter
ingorichter / script-template.sh
Created January 4, 2021 15:39 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]

Keybase proof

I hereby claim:

  • I am ingorichter on github.
  • I am ingorichter (https://keybase.io/ingorichter) on keybase.
  • I have a public key ASA96HzC-n-VzOhme4q21L5CoU6QGrU1bJ-u1QPxDud1qAo

To claim this, I am signing this object:

@ingorichter
ingorichter / extractbusinesslocationjson.sh
Created June 3, 2018 19:11
Extract business location JSON from impossiblefoods.js
curl https://www.impossiblefoods.com/scripts/main.js | tr '\n' '\a' | grep -o "e.exports=\[{geometry:.*\"}}]},{}\]," | sed "s/e.exports=//" | sed "s/},{}],//" | sed "s/\([a-zA-Z]*\):/\"\1\":/g" | sed "s/\"\"https\"/\"https/g" | sed "s/\"ext\":/ext:/" | sed "s/\"coordinates\":\[,\]/\"coordinates\":\[0,0\]/g" | tr -d '\a' > result.js
ffmpeg -i https://host/playlist.m3u8 -c copy -bsf:a aac_adtstoasc OUTPUT-FILE-NAME.mp4
@ingorichter
ingorichter / designer.html
Created November 18, 2014 21:28
designer
<link rel="import" href="../paper-toast/paper-toast.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@ingorichter
ingorichter / result-integration.xml
Created May 11, 2014 00:22
Brackets Integration Test Suite Results Linux
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="StringMatch" errors="0" tests="0" failures="0" time="0" timestamp="2014-05-08T12:35:43">
</testsuite>
<testsuite name="StringMatch _generateMatchList" errors="0" tests="6" failures="0" time="0" timestamp="2014-05-08T12:35:43">
undefined
undefined
undefined
undefined
undefined
@ingorichter
ingorichter / result-extension.xml
Created May 11, 2014 00:20
Brackets Extension Test Suite Results Linux
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="StringMatch" errors="0" tests="0" failures="0" time="0" timestamp="2014-05-08T13:09:04">
</testsuite>
<testsuite name="StringMatch _generateMatchList" errors="0" tests="6" failures="0" time="0" timestamp="2014-05-08T13:09:04">
undefined
undefined
undefined
undefined
undefined
@ingorichter
ingorichter / result-unit-suite.xml
Created May 11, 2014 00:16
Brackets Unit Test Suite Failures Linux
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="Async" errors="0" tests="0" failures="0" time="0" timestamp="2014-05-08T13:23:27">
</testsuite>
<testsuite name="Async Chain" errors="0" tests="0" failures="0" time="0" timestamp="2014-05-08T13:23:27">
</testsuite>
<testsuite name="Async Chain Zero-argument deferreds" errors="0" tests="6" failures="0" time="0.141" timestamp="2014-05-08T13:23:27">
<testcase classname="Async Chain Zero-argument deferreds" name="[zero-arg] work with a null argument array" time="0.064"></testcase>
<testcase classname="Async Chain Zero-argument deferreds" name="[zero-arg] call error callback when first deferred fails" time="0.012"></testcase>
<testcase classname="Async Chain Zero-argument deferreds" name="[zero-arg] call error callback when middle deferred fails" time="0.011"></testcase>
@ingorichter
ingorichter / SendKeyboardEvents
Created March 21, 2014 22:06
Workaround to send KeyboardEvents in Webkit
/*
* This function helps to resolve an issue with sending Keyboard Events in Webkit
*/
function sendKeyEvent(window, k) {
var oEvent = window.document.createEvent('KeyboardEvent');
// Chromium Hack
Object.defineProperty(oEvent, 'keyCode', {
get : function () {
return this.keyCodeVal;
it("should show only warnings for the current file", function () {
CodeInspection.toggleEnabled(false);
var deferred = new $.Deferred();
var asyncProvider = {
name: "Test Async Linter",
scanFileAsync: function () {
return deferred.promise();
}