Skip to content

Instantly share code, notes, and snippets.

View goaround's full-sized avatar

Johannes Kinast goaround

View GitHub Profile

Add to Buffer (in iframe)

Use this handy javascript snippet to add an "Add to Buffer" bookmark. Then you can add anything to your Buffer, anytime, all without leaving the page.

How it works

First, copy the following into your clipboard (it's the attached Javascript, but formatted as a bookmarklet):

javascript:(function()%7Bfunction%20c(a%2Cb)%7BbaseUrl%3D%22%2F%2Fbufferapp.com%2Fadd%3F%22%3Breturn%20baseUrl%2B%22url%3D%22%2Bd(a)%2B%22%26text%3D%22%2Bd(b)%7Dvar%20d%3DencodeURIComponent%3Bc(window.location.href%2Cwindow.document.title)%3Bvar%20a%3Ddocument.createElement(%22iframe%22)%3Ba.setAttribute(%22style%22%2C%22width%3A%20900px%3B%20height%3A%20500px%3B%20position%3A%20fixed%3B%20top%3A%2050%25%3B%20left%3A%2050%25%3B%20margin-left%3A%20-450px%3B%20margin-top%3A%20-250px%3B%20background%3A%20%23fff%3B%20border%3A%20solid%201px%20%23000%3B%20z-index%3A%201000%3B%22)%3Ba.setAttribute(%22frameborder%22%2C%220%22)%3Burl%3Dc(document.location.href%2Cdocument.title)%3Ba.src%3Durl%3Bdocument.body.a
@hlashbrooke
hlashbrooke / function.php
Created February 28, 2014 08:41
WordPress: Add post types to the 'At a glance' widget
<?php
add_filter( 'dashboard_glance_items', 'custom_glance_items', 10, 1 );
function custom_glance_items( $items = array() ) {
$post_types = array( 'post_type_1', 'post_type_2' );
foreach( $post_types as $type ) {
if( ! post_type_exists( $type ) ) continue;
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */