Skip to content

Instantly share code, notes, and snippets.

View franz-josef-kaiser's full-sized avatar

Franz Josef Kaiser franz-josef-kaiser

View GitHub Profile
@franz-josef-kaiser
franz-josef-kaiser / spam
Created April 24, 2013 17:05 — forked from shanselman/gist:5422230
A spammers complete build string
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@franz-josef-kaiser
franz-josef-kaiser / setup.sh
Created May 14, 2013 12:17
Setup file for a Symfony2 project
#!/bin/sh
### COLOUR DEFINITIONS
WHITE='\e[0;47;30m'
GREEN='\e[1;36;40m'
RED='\e[1;31;40m'
THREAD='\e[1;35;40m'
NONE='\e[0m'
@franz-josef-kaiser
franz-josef-kaiser / var_dump.js
Created May 27, 2013 06:26
A console.log() alias that takes an infinite and undefined amount of arguments.
function var_dump() {
for ( var i=0; i < arguments.length; i++ ) {
console.log( arguments[i] );
}
}
@franz-josef-kaiser
franz-josef-kaiser / ajax.js
Created May 29, 2013 20:30
Test to prove that I can't register two callbacks to the same `wp_ajax_{$action}`
;( function( $, obj ) {
var uno = function( e ) {
e.preventDefault();
var $this = $( this );
$.ajax( {
type: "POST",
url: obj.ajaxurl
+ "?action=" + obj.action
@franz-josef-kaiser
franz-josef-kaiser / calendars.md
Created June 4, 2013 09:35
A list of Javascript Calendars
@franz-josef-kaiser
franz-josef-kaiser / simplepie_example.php
Created June 7, 2013 17:31
SimplePie - example method to list what information we can retrieve about a feed as a whole and for single items when looping through
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) RSS Importer
*/
add_action( 'plugins_loaded', array( 'WCMRSSImporterBootstrap', 'init' ) );
class WCMRSSImporterBootstrap
{
protected static $instance = null;
@franz-josef-kaiser
franz-josef-kaiser / wpmail_exceptions.php
Last active May 28, 2024 07:30
WP Mail Error/Exception handling and SMTP settings
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) PHPMailer Exceptions & SMTP
* Description: WordPress by default returns <code>FALSE</code> instead of an <code>Exception</code>. This plugin fixes that.
*/
add_action( 'phpmailer_init', 'WCMphpmailerException' );
function WCMphpmailerException( $phpmailer )
{
<?php
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations['topnav'] );
$menu_items = wp_get_nav_menu_items( $menu->term_id, array(
'order' => 'DESC',
) );
?>
<select class="the-selectors" onChange="document.location.href=this.options[this.selectedIndex].value;">
<option value="">
@franz-josef-kaiser
franz-josef-kaiser / limit_admin_post_list_fields.php
Created July 3, 2013 13:04
Speed up the post list views in WordPress admin UI screens. Reduce the queried fields to what is needed to display the posts and what "Quick Edit" needs. Saved time increases with a higher limit set for `posts_per_screen` in the screen options drop down.
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) Faster Admin Post Lists
* Description: Reduces the queried fields inside WP_Query for WP_Post_List_Table screens
* Author: Franz Josef Kaiser <wecodemore@gmail.com>
* AuthorURL: http://unserkaiser.com
* License: MIT
*/
<?php
/**
* Tabs vs. Spaces
*/
// This is Tabs/Tabs
$array = (
'some_var' => 'some_val',
'key' => 'val',
'k' => 'v',
'some_variable_here' => 'some_value_here',