Skip to content

Instantly share code, notes, and snippets.

View Khoulaiz's full-sized avatar
🏠
Working from home

Andreas Sahlbach Khoulaiz

🏠
Working from home
View GitHub Profile
var inputs = document.getElementsByTagName('input');
for (var i=0; i < inputs.length; i++) {
if (inputs[i].getAttribute('type').toLowerCase() === 'password') {
inputs[i].setAttribute('onpaste', '');
}
}
@Khoulaiz
Khoulaiz / gist:6be569b7626e0db9413d
Created January 28, 2016 18:08
CCcam.cfg entry for Vodafone KD
SMARTCARD CLOCK FREQUENCY: /dev/sci0 3570000
BOXKEY: /dev/sci0 12 34 56 78
TRY ALL CHIDS: /dev/sci0
SMARTCARD CLOCK FREQUENCY: /dev/sci1 3570000
BOXKEY: /dev/sci1 12 34 56 78
@Khoulaiz
Khoulaiz / nginx-lang.lua
Created January 30, 2016 08:58 — forked from colthreepv/nginx-lang.lua
Detect preferred language script for Nginx written in LUA
-------------------------------------------------------------------------------
-- HTTP Accept-Language header handler --
-- @originalAuthor: f.ghibellini@gmail.com --
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang--
-- @modifiedBy: marian.hello@mapilary.com --
-- @gist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 --
-- @license: MIT --
-- @requires: --
-- @description: --
-- returns language with greatest quality --
@Khoulaiz
Khoulaiz / keybase.md
Created August 25, 2016 19:16
keybase.md

Keybase proof

I hereby claim:

  • I am Khoulaiz on github.
  • I am khoulaiz (https://keybase.io/khoulaiz) on keybase.
  • I have a public key whose fingerprint is A15C 4B1F F63B B0DA 9DC3 8C16 FBFF 0F87 219E 23C0

To claim this, I am signing this object:

@Khoulaiz
Khoulaiz / check_dyn_hostname
Created August 30, 2013 13:46
check dyndns hostname and reload iptables to reavaluate dynamic hostnames from iptables config. put this in a cronjob and you can use dyndns entries in iptables configs.
#!/bin/bash
# check dyndns name of a host and reset iptables if change was detected
HOSTNAME=<hostname-to-check.dyndns.org>
LOGFILE=/var/run/check_home_ip
Current_IP=$(/usr/bin/dig +short $HOSTNAME)
if [ $LOGFILE = "" ] ; then
iptables-restore </etc/iptables_rules
@Khoulaiz
Khoulaiz / gist:2a186f75fce26b77a8dcaad63e59bf41
Created March 29, 2017 10:29
Show Gradle Input and Output Files of every Task during run
gradle.taskGraph.afterTask {task ->
StringBuffer taskDetails = new StringBuffer()
taskDetails << "-------------\nname:$task.name group:$task.group : $task.description\nconv:$task.convention.plugins\ninputs:"
task.inputs.files.each{ it ->
taskDetails << "${it.absolutePath}\n"
}
taskDetails << "outputs:\n"
task.outputs.files.each{ it ->
taskDetails << "${it.absolutePath}\n"
}
@Khoulaiz
Khoulaiz / .profile
Created May 16, 2017 20:54 — forked from tasmo/.profile
snipped for ediff with emacsclient for POSIX shells
### editor
export ALTERNATE_EDITOR=emacs
export EDITOR="emacsclient -tc -a emacs"
export VISUAL="emacsclient -c -a emacs"
# emacsclient as difftool
function ediff () {
if [ "X${2}" = "X" ]; then
echo "USAGE: ediff <FILE 1> <FILE 2>"
else
quoted1=${1//\\/\\\\}; quoted1=${quoted1//\"/\\\"}
@Khoulaiz
Khoulaiz / ec
Last active May 16, 2017 20:56 — forked from tasmo/ec
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/usr/bin/env bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@Khoulaiz
Khoulaiz / spacemacs-cheatsheet.md
Created August 22, 2017 11:17 — forked from davoclavo/spacemacs-cheatsheet.md
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
// ==UserScript==
// @name Amazon Prevent language switch away from German
// @description Some amazon urls will change your language settings. Only use german versions
// @namespace https://sahlbach.com/misc/greasemonkey/
// @match https://*.amazon.de/-/*/dp/*
// @exclude https://*.amazon.de/-/de/dp/*
// @run-at document-start
// @version 1
// @grant none
// @icon https://www.amazon.com/favicon.ico