Skip to content

Instantly share code, notes, and snippets.

View ocean90's full-sized avatar
🌊
Surfing the open source wave

Dominik Schilling ocean90

🌊
Surfing the open source wave
View GitHub Profile
@ocean90
ocean90 / gist:4504872
Created January 10, 2013 19:12
Customize the title attributes of term links in the widget tag cloud
<?php
/**
* Adds additional args to the widget tag cloud:
* format => array
* topic_count_text_callback => my_remove_default_tag_title
*
*/
function my_add_type_arg( $args ) {
$args['format'] = 'array';
$args['topic_count_text_callback'] = 'my_remove_default_tag_title';
@ocean90
ocean90 / gist:4155626
Created November 27, 2012 17:17
Update a fork, pull in changes from the original repo
# https://help.github.com/articles/fork-a-repo
$ git remote add upstream git@github.com:{user-name}/{project-name}.git
$ git fetch upstream
$ git merge upstream/master
$ git push origin
@ocean90
ocean90 / auto-embeds-disabler.php
Created September 27, 2012 21:42
WordPress Plugin: Auto-embeds Disabler
<?php
/**
* Plugin Name: Auto-embeds Disabler
* Version: 0.1
* Description: Disables the auto-embeds function in WordPress 3.5
* Author: Dominik Schilling
* Author URI: http://wphelper.de/
* Plugin URI: http://wpgrafie.de/1078/
*
*
@ocean90
ocean90 / xml-rpc-disabler.php
Created September 27, 2012 15:04
WordPress Plugin: XML-RPC Disabler
<?php
/**
* Plugin Name: XML-RPC Disabler
* Version: 0.1
* Description: Disables the XML-RCP API in WordPress 3.5
* Author: Dominik Schilling
* Author URI: http://wphelper.de/
* Plugin URI: http://wpgrafie.de/994/
*
*
@ocean90
ocean90 / plugin.php
Created September 19, 2012 19:22
WordPress: Print some debug infos into backend footer.
/**
* For site admins: Print some debug infos into backend footer.
* - Time
* - DB Queries
* - Memory Usage
* - Cache Hts/Misses
* - Active Plugins
*
* @param string $text Existing footer text.
*
@ocean90
ocean90 / post.html
Created September 6, 2012 08:39
Add/load social plugins after 5 seconds
<div class="share-box twitter">
<span>Auf Twitter teilen</span>
<a style="display:none" href="https://twitter.com/share" class="twitter-share-button" data-lang="de" data-dnt="true" data-count="vertical">Twittern</a>
</div>
<div class="share-box googleplus">
<span>Auf Google+ teilen</span>
<div class="g-plusone" data-size="tall"></div>
</div>
@ocean90
ocean90 / plugin.php
Created September 4, 2012 15:18
WordPress: Return the X-XSS-Protection = 0 header for post previews
/**
* Add a X-XSS-Protection = 0 header for post previews to allow
* Webkit browsers to render iframe and flash objects.
* @see: http://core.trac.wordpress.org/ticket/20148
*
* @param $headers array Already added header items.
* @param $object WP The query variables.
*
* @return array
*/
@ocean90
ocean90 / gist:3621458
Created September 4, 2012 14:07
Dropbox: "In Konflikt stehende Kopie" Dateien finden und verschieben/löschen
mkdir ~/Documents/Conflicted && find -L ~/Dropbox -name "*In Konflikt stehende Kopie*" -exec mv {} ~/Documents/Conflicted \;
@ocean90
ocean90 / gist:3307536
Created August 9, 2012 19:56
Lets PHPUnit use MAMP's MySQL socket
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
@ocean90
ocean90 / wp-search-images.sh
Last active September 5, 2024 01:33
Check WordPress core for unused images.
#!/bin/bash
# Checks WordPress core for unused images.
# Requires ack2: http://beyondgrep.com/
#
# The script needs to be placed inside the WordPress root
# directory or add the path to the WordPress directory via a
# parameter. Example: $ ./wp-search-images ~/Sites/WordPress/
#
# Define the image paths in img_paths[]
#