Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
2ndkauboy / array_keys_not_empty.php
Created April 7, 2014 16:14
A handy function to check for an array if all key do exist and none of them has an empty value
/**
* Check an array if all key to exists and none of them has an empty value
*
* @param array $array The array.
* @param array $keys The searched keys.
* @return boolean returns true, if all keys existed in the array and none of them had empty values
*/
function array_keys_not_empty($keys, $array){
foreach($keys as $key){
@2ndkauboy
2ndkauboy / colors-Twilight_optimized.icls
Created October 9, 2014 21:44
My current PhpStorm color scheme (Twilight with file status colors from the Dracula scheme and Consolas as the main font)
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Twilight_optimized" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="CONSOLE_FONT_NAME" value="Lucida Console" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="CARET_COLOR" value="a7a7a7" />
<option name="CARET_ROW_COLOR" value="1b1b1b" />
<option name="CONSOLE_BACKGROUND_KEY" value="141414" />
<?php
/*
* Plugin Name: Text-Widget Highlighted
* Description: Extends the WordPress default text widget by adding a CSS class "widget_text_highlighted" to the container aside HTML tag
* Version: 0.1
* Author: Bernhard Kau
* Author URI: http://kau-boys.de
*/
@2ndkauboy
2ndkauboy / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@2ndkauboy
2ndkauboy / Eclipse Windows German.xml
Created April 2, 2015 14:01
PhpStorm Eclipse keymap for German keyboards on Windows
<keymap version="1" name="Eclipse Windows German" parent="Eclipse">
<action id="QuickChangeScheme">
<keyboard-shortcut first-keystroke="control DEAD_ACUTE" />
</action>
<action id="Vcs.QuickListPopupAction">
<keyboard-shortcut first-keystroke="alt DEAD_ACUTE" />
</action>
</keymap>
@2ndkauboy
2ndkauboy / Twilight_with_Dracula.icls
Last active August 29, 2015 14:18
PhpStorm Twilight color theme when using the Dracula IDE theme
<scheme name="Twilight_with_Dracula" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="CONSOLE_FONT_NAME" value="Lucida Console" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="ANNOTATIONS_COLOR" value="8b999f" />
<option name="CARET_COLOR" value="a7a7a7" />
<option name="CARET_ROW_COLOR" value="1b1b1b" />
<option name="CONSOLE_BACKGROUND_KEY" value="141414" />
@2ndkauboy
2ndkauboy / jquery.formrescuer.js
Created August 25, 2015 11:42
A jQuery plugin to prevent a user to navigate off of a page without saving the form data
;(function($) {
var settings = {
'warnings' : {
'unsavedform': 'ACHTUNG: Ihre Änderungen wurden noch nicht gespeichert!\n\nDrücken Sie "Auf dieser Seite bleiben" und speichern Sie die Daten! Wenn Sie auf "Diese Seite verlassen" klicken gehen Ihre Änderungen verloren!',
'unsavedtab': 'ACHTUNG: Ihre Änderungen wurden noch nicht gespeichert!\n\nDrücken Sie "Abbrechen" und speichern Sie die Daten! Wenn Sie auf "OK" klicken gehen Ihre Änderungen verloren!'
},
'submitted' : false
};
<?php
/**
* Plugin Name: MailPoet Load Textdomain Fix
* Description: This plugin will deactivate the translation laoding from the MailPoet plugin and load it in the correct was instead, so other plugins that hook into the loading of translations works together with MailPoet
* Version: 1.0
* Author: Bernhard Kau
* Author URI: http://kau-boys.com
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0
@2ndkauboy
2ndkauboy / helvetica-neue-desk-interface-reset.css
Created October 28, 2014 23:29
Reset the HTML form buttons font-family from "Helvetica Neue Desk Interface", forced by OS X Yosemite, back to it's original font-family.
input[type="submit"], input[type="reset"], input[type="button"], button {
font-family: inherit;
-webkit-font-smoothing: inherit;
}