Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
2ndkauboy / .gitignore
Last active October 16, 2019 09:12
MemberPress German Translation
*
!/memberpress-de_DE.*
@2ndkauboy
2ndkauboy / taxonomy-gallery-shortcode.php
Last active April 15, 2019 15:25
Adding the shortcode "taxonomy_gallery" to list all images for a given taxonomy
@2ndkauboy
2ndkauboy / textdomain-de_DE.po
Last active December 12, 2018 19:05
This template can be used to create a po file for a new WordPress translation (in this example for the locale de_DE)
msgid ""
msgstr ""
"Project-Id-Version: <PROJECT NAME>\n"
"POT-Creation-Date: 2015-04-02 16:42+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@2ndkauboy
2ndkauboy / disable-translation-updates.php
Last active August 18, 2018 15:10
A small WordPress plugin to disable the asynchronous and automatic background translation updates
<?php
/*
Plugin Name: Disable Translation Updates
Plugin URI: https://gist.github.com/2ndkauboy/1907f5847b4e092a88ac
Description: Disable the asynchronous and automatic background translation updates
Version: 1.0.0
Author: Bernhard Kau
Author URI: http://kau-boys.de
License: GPL
*/
<?php
/*
Plugin Name: Disable Full Size Image
Description: This plugin removes the "Original Size" option in the drop down when inserting an image into a post
Version: 0.1
Author: Bernhard Kau
Author URI: http://kau-boys.de
*/
function disable_full_size_image( $image_size_names ) {
@2ndkauboy
2ndkauboy / author-bio-target-blank.php
Last active August 18, 2018 15:09
Add target="_blank" to all URLs in the post author bio
<?php
/*
Plugin Name: Author Bio Target Blank
Plugin URI: https://gist.github.com/2ndkauboy/7136933
Description: Add target="_blank" to all URLs in the post author bio
Version: 0.1
Author: Bernhard Kau
Author URI: http://kau-boys.de
*/
@2ndkauboy
2ndkauboy / grep_infections.sh
Created May 21, 2014 12:28
This is a simple bash script, that scans text files for typical infections and sends an email to the user. Just setup a cron and run it every couple of hour. And don't worry, even scanning thousand of text files will only take some seconds.
#!/bin/bash
grep '#[0-9a-fA-F]\{6\}#' -r -H -lc /var/www/ --include=*.{html,js,css,php,tpl,sh,py,java,class} | # Only get found issues
/usr/bin/mail -E -s 'INFECTED FILES FOUND on example.com' mail@example.com # Send EMail
grep '/\*[0-9a-fA-F]\{6\}\*/' -r -H -lc /var/www/ --include=*.{html,js,css,php,tpl,sh,py,java,class} | # Only get found issues
/usr/bin/mail -E -s 'INFECTED FILES FOUND on example.com' mail@example.com # Send EMail
grep 'e=w\["eval"\]' -r -H -lc /var/www/ --include=*.{html,js,css,php,tpl,sh,py,java,class} | # Only get found issues
/usr/bin/mail -E -s 'INFECTED FILES FOUND on example.com' mail@example.com # Send EMail
grep '<!--/[0-9a-fA-F]\{6\}-->' -r -H -lc /var/www/ --include=*.{html,js,css,php,tpl,sh,py,java,class} | # Only get found issues
/usr/bin/mail -E -s 'INFECTED FILES FOUND on example.com' mail@example.com # Send EMail
grep 'r=eval' -r -H -lc /var/www/ --include=*.{html,js,css,php,tpl,sh,py,java,class} | # Only get found issues
<?php
/**
* CapitalizeDangit
*
* @package CapitalizeDangit
* @author Bernhard Kau
* @license GPLv3
*
* @wordpress-plugin
* Plugin Name: CapitalizeDangit
@2ndkauboy
2ndkauboy / not.css
Last active October 11, 2016 12:18
:not
/********Link-Klasse****/
a.download-button {
color: #fff !important;
background: #c8504b;
padding: 10px 20px;
border-radius: 2px;
margin: 5px;
}
/****** angewendeter Code auf alle Links, die nicht .fy-button als Klasse haben ***/