Skip to content

Instantly share code, notes, and snippets.

View mabe-at's full-sized avatar

Matthias Bendel mabe-at

View GitHub Profile
@mabe-at
mabe-at / ffos_input-reset.js
Last active August 29, 2015 14:05
Firefox OS Building Blocks Input Reset JS
// helper for iterating NodeList of element objects
var forEach = Array.prototype.forEach;
forEach.call(
document.querySelectorAll('form p input + button[type="reset"], form p textarea + button[type="reset"]'),
function( el ) {
el.addEventListener ('mousedown', function () {
var field = document.querySelector('input:focus , textarea:focus');
field.value = field.defaultValue;
});
@mabe-at
mabe-at / ffos_bb_nice.css
Created August 27, 2014 00:26
overriding building blocks css
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea {
-moz-box-sizing: border-box;
}
@mabe-at
mabe-at / otrs_generic-agent_salearn.pl
Last active August 29, 2015 14:05
OTRS Generic Agent salearn
#!/usr/bin/perl -w
# use ../ as lib location
use File::Basename;
use FindBin qw($RealBin);
use lib dirname($RealBin);
use lib dirname($RealBin)."/Kernel/cpan-lib";
use strict;
# to get it readable for the webserver user and writable for otrs
# group (just in case)
umask 002;

Keybase proof

I hereby claim:

  • I am mabe-at on github.
  • I am mbendel (https://keybase.io/mbendel) on keybase.
  • I have a public key whose fingerprint is 6742 D3D2 596C 2901 A022 C45E 8AAA 3AF0 1227 9A06

To claim this, I am signing this object:

@mabe-at
mabe-at / mozcontact_fields.txt
Last active August 29, 2015 14:26
MozContact properties as comment for quick insertion into code
/**
* MozContact.additionalName string array
* MozContact.adr AddressField object array
* type string ("home", "work", ...)
* pref bool
* streetAddress string
* locality string (city)
* region string
* postalCode string
* countryName string
@mabe-at
mabe-at / pdf-unite.sh
Created October 7, 2015 22:54
pdfunite $(ls -v *.pdf) output.pdf // poppler
pdfunite $(ls -v *.pdf) output.pdf
$(function() {
$(document.links).filter(function() {
return this.hostname != window.location.hostname;
}).attr('target', '_blank');
});
@mabe-at
mabe-at / detector.js
Created August 25, 2017 15:57 — forked from mauricesvay/detector.js
Original js implementation of face detection
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@mabe-at
mabe-at / auth.pl
Created January 18, 2018 21:33 — forked from mmriis/auth.pl
IMAP/POP3 proxy authentication script for nginx. See http://www.whatastruggle.com/nginx-as-an-imappop3-proxy-part-2.
#!/usr/bin/perl
use Digest::HMAC_MD5 qw/ hmac_md5_hex /;
use DBI;
use URI::Escape;
use CGI;
print "Content-type: text/html\n";
my $q = CGI->new;
@mabe-at
mabe-at / deinterlace.sh
Created June 7, 2018 07:29
imagemagick deinterlace
#!/bin/sh
#
# deinterlace image...
# from https://www.imagemagick.org/Usage/scripts/
#
# Smoothly double up every second line so as to de-interlace video snapshots.
#
exec mogrify -filter point -resize 100%x50% +filter -resize 100%x200% "$@"