Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
Surfing the open source wave

Dominik Schilling ocean90

🌊
Surfing the open source wave
View GitHub Profile
@ocean90
ocean90 / fbcbfwss.php
Last active Jun 8, 2021
WordPress Plugin: Filename-based cache busting for scripts/styles.
View fbcbfwss.php
<?php
/**
* Plugin Name: Filename-based cache busting
* Version: 0.3
* Description: Filename-based cache busting for WordPress scripts/styles.
* Author: Dominik Schilling
* Author URI: http://wphelper.de/
* Plugin URI: https://dominikschilling.de/880/
*
* License: GPLv2 or later
@ocean90
ocean90 / load-jquery-in-footer-php53.php
Created Mar 3, 2012
WordPress: Print jQuery in footer on front-end.
View load-jquery-in-footer-php53.php
@ocean90
ocean90 / fixit.sh
Created May 6, 2012 — forked from jerolimov/fixit.sh
GetMama remove script
View fixit.sh
#!/bin/bash
#
# Copyright 2012 Christoph Jerolimov, Dominik Schilling
#
# 0) No, i did not developed this for myself/my server. ;-)
# 1) I strongly recommend you to reinstall all your server software,
# inclusive the whole operating system like linux, unix, etc. If you
# use a web hosting service, backup your data and request your
# provider for a fresh system. If this is not possible feel free to
# try this script.
@ocean90
ocean90 / compress.sh
Created Jun 16, 2012
Shell: Find PNG images and compress with PNGOUT
View compress.sh
# Get PNGOUT from here: http://www.jonof.id.au/kenutils
find . -regex ".*\.\(png\)" | while read FILE; do
pngout -y "$FILE"
done;
@ocean90
ocean90 / wp-search-images.sh
Last active Oct 8, 2015
Check WordPress core for unused images.
View wp-search-images.sh
#!/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[]
#
@ocean90
ocean90 / gist:3307536
Created Aug 9, 2012
Lets PHPUnit use MAMP's MySQL socket
View gist:3307536
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
@ocean90
ocean90 / gist:3621458
Created Sep 4, 2012
Dropbox: "In Konflikt stehende Kopie" Dateien finden und verschieben/löschen
View gist:3621458
mkdir ~/Documents/Conflicted && find -L ~/Dropbox -name "*In Konflikt stehende Kopie*" -exec mv {} ~/Documents/Conflicted \;
@ocean90
ocean90 / plugin.php
Created Sep 4, 2012
WordPress: Return the X-XSS-Protection = 0 header for post previews
View plugin.php
/**
* 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 / post.html
Created Sep 6, 2012
Add/load social plugins after 5 seconds
View post.html
<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 Sep 19, 2012
WordPress: Print some debug infos into backend footer.
View plugin.php
/**
* 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.
*