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 / scrolltotop.php
Created Dec 4, 2011
Click on the Admin Bar to scroll to top
View scrolltotop.php
<?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 Dec 11, 2011
Print Style for Shower
View gist:1463235
/*PART FOR PRINTING */
@media all {
.page-break { display:none; }
}
@media print {
@page {
size: A4 portrait;
}
.caption {
@ocean90
ocean90 / google-plus-feed.php
Created Dec 19, 2011
WordPress Page Template to build a feed of your Google+ stream
View google-plus-feed.php
<?php
/**
* Template Name: Google+ Feed
*/
/**
* A WordPress page template for a Google+ feed.
*
* @author Dominik Schilling
@ocean90
ocean90 / gist:1544377
Created Dec 31, 2011
Compiling Compass.app on Mac OS X
View gist:1544377
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 Jan 2, 2012
Custom border radius mixin for Compass
View gist:1549988
// 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 Jan 2, 2012
Convert px to em
View gist:1552031
// 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 Jan 8, 2012
Gist to WordPress
View all-in-one.php
/**
* 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 Feb 2, 2012
Remove gravatar from the WordPress Toolbar
View plugin.php
<?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 Feb 13, 2012
wpSEO Monitor um Google+ Einkreisungen ergänzen.
View seo-monitor-googleplus.php
<?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 Feb 15, 2012
Remove Comment Author IPs
View remove-comment-ips.php
<?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