Skip to content

Instantly share code, notes, and snippets.

View miller45's full-sized avatar
🙂

Ramon Klein miller45

🙂
View GitHub Profile
awk '/findme/ { if($11!="\"-\"" && $11 !~ "(Bot|bot)") print $11 } ' FPAT='([^ ]+)|("[^"]+")' /var/log/apache2/access.log
awk '/findme/ { if($11!="\"-\"" && $11 !~ "(Bot|bot)") print $11 } ' FPAT='([^ ]+)|("[^"]+")' /var/log/apache2/access.log
@miller45
miller45 / whennil.pipe.spec.ts
Created December 11, 2019 16:44
whenNilPipe for angular
/*
* @author RKlein
*/
import { WhenNilPipe } from "./whennil.pipe";
describe('WhenNilPipe', () => {
it('converts null to "--"', () => {
let converter = new WhenNilPipe();
PROCEDURE ADAPTTOMODERNTERMINAL
PRIVATE term,lang
IF AppIoMode() == "T"
lang := getenv("LANG")
term := getenv("TERM")
IF RAT("UTF-8",lang) > 0 .AND. (term == "xterm" .OR. term =="xterm-256color")
//we are in UTF terminal so switch at least to iso output
FS_SET("terminal", term)
@miller45
miller45 / rf.items
Created November 14, 2019 17:35
RfBridge Funkschalter Beispiel Regeln
// item fuer die RfBridge... hier weiss ich noch nicht wie man das fuer mehrer Schalter machen kann
String RfBridge "RfKey [%s]" {mqtt="<[mosq:tele/sonoff/30/RESULT:state:default]"}
@miller45
miller45 / fshit
Last active November 5, 2019 19:05
launches a flagship app with newfsterm in xterm while checking for oldschool keyboard mapping like HOME or END key
#!/bin/sh
# launches flagship program via xterm with parameters correction keyboard mapping (for old clipper software)
xterm -xrm \
"XTerm*VT100.Translations: #override \n\
<KeyPress> Home : string(0x01)\n\
<KeyPress> End : string(0x06)\n" \
-e newfsterm $1 &
@miller45
miller45 / protractor-mouse-plugin.js
Created September 23, 2019 08:22
mouse plugin for protractor 5.4.x
//copied but modernized from https://gist.github.com/OrganicPanda/ba22c6dec89ffa7673a27ec28e08aa89
// Hook in to `addEventListener` to track the mouse and display it as a circle
var MousePlugin = function () {
};
MousePlugin.prototype.onPageLoad = function () {
console.log("mousePlugin");
return browser.executeScript(function () {
(function () {
@miller45
miller45 / ieversnippet.js
Created September 5, 2019 07:45
get all internet explroer versions
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
// see https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx
// but for ie 11 doenst work this way
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;