Skip to content

Instantly share code, notes, and snippets.

View bueltge's full-sized avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
@bueltge
bueltge / Singleton.php
Created January 13, 2012 11:34
Vererbung Singleton; Gewährleistung, dass Kind-Klassen Singletons sind, spätere Kind-Klassen aber nicht irgendetwas anderes werden können
class Singleton {
private static $_instances = array();
final public static function getInstance() {
return ! isset( self::$_instances[ get_called_class() ] )
? self::$_instances[ get_called_class() ] = new static
: self::$_instances[ get_called_class() ];
}
@bueltge
bueltge / gist:1619667
Created January 16, 2012 07:49
Navigating with jQuery Keyboard Shortcuts
( function ( $ ) {
$( document ).keydown( function( e ) {
var url = false;
if ( 37 == e.which ) { // Left arrow key code
url = $( '.prev a' ).attr( 'href' ); // set right class
}
else if ( 39 == e.which ) { // Right arrow key code
url = $( '.next a' ).attr( 'href' ); // set right class
}
@bueltge
bueltge / remove_br_in_pre.php
Created January 23, 2012 15:03
Code to Question on WPSE questions 39843
<?php
/**
* Plugin Name: Remove br in pre
* Plugin URI: http://wordpress.stackexchange.com/questions/39843/no-filter-of-code-on-switch-from-html-to-visual-editor-how
* Text Domain:
* Domain Path: /languages
* Description:
* Version: beta
* Author: Frank Bültge
* Author URI: http://bueltge.de
@bueltge
bueltge / github-ribbon.html
Created January 27, 2012 10:23
Github Ribbon only with css3
<a id="github" href="https://github.com/bueltge">
<span>Fork me on GitHub!</span>
<span>Get free lemonade!</span>
</a>
<?php
/**
* Plugin Name: Remove Gravatar on Admin Bar
* Plugin URI: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch
* Description: Remove Gravatar on Admin Bar
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
@bueltge
bueltge / dabblet.css
Created February 8, 2012 11:24
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
margin: 5em;
}
.tooltip {
font: normal 11px/17px sans-serif;
/* View and change on http://dabblet.com/gist/1787522
*/
body {
margin: 7em 3em;
}
button,
input,
select,
textarea {
@bueltge
bueltge / class_fb_backlink_checker.php
Last active March 21, 2025 11:51
Backlink Checker
@bueltge
bueltge / gist:2304293
Created April 4, 2012 18:01
Remove hierarchy on WordPress Category meta box
add_action( 'add_meta_boxes', 'do_my_meta_boxes' );
function do_my_meta_boxes( $post_type ) {
remove_meta_box( 'my_taxonomydiv', $post_type, 'side' );
add_meta_box( 'my_taxonomydiv', 'My Taxonomy', 'my_meta_box', $post_type, 'side' );
}
function my_meta_box( $post, $meta_box ) {
$taxonomy = 'my_taxonomy';
$tax = get_taxonomy( $taxonomy );
@bueltge
bueltge / example.php
Created April 21, 2012 21:24
WordPress Widget Order via CSS; Here is a simple filter to automatically add a class attribute like widget-order-1 to all widgets within sidebars
add_action( 'init', 'add_widget_order_class' );
function add_widget_order_class() {
global $wp_registered_sidebars, $wp_registered_widgets;
$sidebars = wp_get_sidebars_widgets();
if ( empty( $sidebars ) )
return;
foreach ( $sidebars as $sidebar_id => $widgets ) {