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 / scrolltotop.php
Created December 4, 2011 00:02
Click on the Admin Bar to scroll to top
<?php
function ds_admin_bar_scrolltop() {
if ( ! is_admin_bar_showing() )
return;
?>
<script>
( function( $ ) {
$( '#wpadminbar' ).click( function() {
$( 'html, body' ).animate( { scrollTop: 0 }, 100 );
@ocean90
ocean90 / gist:1463235
Created December 11, 2011 22:41
Print Style for Shower
/*PART FOR PRINTING */
@media all {
.page-break { display:none; }
}
@media print {
@page {
size: A4 portrait;
}
.caption {
@ocean90
ocean90 / gist:1549988
Created January 2, 2012 09:13
Custom border radius mixin for Compass
// Custom Border Radius
@mixin _border-radius($radius: 5px, $vertical-radius: false) {
@if $vertical-radius {
// Webkit doesn't understand the official shorthand syntax for specifying
// a vertical radius unless so in case there's several we only take the first.
@include experimental(border-radius, first-value-of($radius) first-value-of($vertical-radius),
not -moz,
-webkit,
not -o,
@ocean90
ocean90 / remove-comment-ips.php
Created February 15, 2012 14:40
Remove Comment Author IPs
<?php
/**
* Plugin Name: Remove Comment Author IPs
* Version: 0.1.0
* Description: Removes the IP addresses of comment authors on a scheduled time.
* Author: Dominik Schilling
* Author URI: http://wphelper.de/
* Plugin URI: https://gist.github.com/1836266
*
* License: GPLv2 or later
@ocean90
ocean90 / fixit.sh
Created May 6, 2012 17:08 — forked from jerolimov/fixit.sh
GetMama remove script
#!/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 June 16, 2012 13:51
Shell: Find PNG images and compress with PNGOUT
# 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 October 8, 2015 04:18
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[]
#
@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 / 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 / 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/
*
*