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 / google-plus-feed.php
Created December 19, 2011 08:51
WordPress Page Template to build a feed of your Google+ stream
<?php
/**
* Template Name: Google+ Feed
*/
/**
* A WordPress page template for a Google+ feed.
*
* @author Dominik Schilling
@ocean90
ocean90 / gist:1544377
Created December 31, 2011 15:43
Compiling Compass.app on Mac OS X
Tutorial for compiling the Compass.app (http://compass.handlino.com/)
=====================================================================
Java installed?
java -version
Load jRuby (for example JRuby 1.6.5.1 Binary .zip)
http://jruby.org/download
Unzip jRuby to `/usr/local/`
@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 / gist:1552031
Created January 2, 2012 20:46
Convert px to em
// Default font size
$base-font-size: 16px;
// px2em
// Use: font-size: px2em( 12px, 14px );
@function px2em( $target, $context: $base-font-size ) {
@if $target == 0 {
@return 0;
}
@ocean90
ocean90 / all-in-one.php
Created January 8, 2012 23:28
Gist to WordPress
/**
* Hook into the backend and load scripts and
* init metabox.
*/
function ds_gist2wordpress_admin() {
add_action( 'wp_ajax_gist', 'ds_gistify' );
add_action( 'admin_print_scripts-post.php', 'ds_gist_js' );
add_action( 'admin_print_scripts-post-new.php', 'ds_gist_js' );
@ocean90
ocean90 / plugin.php
Created February 2, 2012 12:25
Remove gravatar from the WordPress Toolbar
<?php
/*
* Entfernt das Gravatar aus der Toolbar.
* @link: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch
*/
/* < PHP 5.3 */
function ds_add_hide_avatar_filter() {
add_filter( 'pre_option_show_avatars', '__return_zero' );
}
@ocean90
ocean90 / seo-monitor-googleplus.php
Created February 13, 2012 20:28
wpSEO Monitor um Google+ Einkreisungen ergänzen.
<?php
/*
* Plugin Name: wpSEO Monitor Addon: Google+ Kennzahl
* Plugin URI: https://plus.google.com/101675293278434581718/posts/2E88QNTcXjE
* Description: Ergänzt den wpSEO Monitor um Google+ Einkreisungen. In wpSEO 3.0.3 bereits fester Bestandteil des Plugin.
* Version: 0.3
* Author: Dominik Schilling
* Author URI: http://wpgrafie.de
* License: GPLv2
*
@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