Skip to content

Instantly share code, notes, and snippets.

View germanny's full-sized avatar

Jen G germanny

View GitHub Profile
// important: note the priority of 99, the js needs to be placed after tinymce loads
// important: note that this assumes you're using http://wordpress.org/extend/plugins/verve-meta-boxes/
// to create the textarea - otherwise change your selector
function admin_add_wysiwyg_custom_field_textarea()
{ ?>
<script type="text/javascript">/* <![CDATA[ */
jQuery(function($){
var i=1;
$('.verve_meta_box_content textarea').each(function(e)
@germanny
germanny / dol-mtg-agenda-201403.md
Last active August 29, 2015 13:56
Dogs Out Loud Meeting Agenda

Dogs Out Loud March Meeting

Place/Time

Jen's Item:

Our next education workshop.

  1. We don't have many leash gremlins to show off, so how about the fearful dog workshop - Building Confidence & Trust - Fearful Dogs.
  2. Maybe let's take over one class next cycle (late April) for this workshop. We hold it at AAC so we can use any of the dogs as demo dogs.
  3. Do we invite AAC volunteers who are not DOL volunteers? That might be nice.
  4. Maybe we can create a 2 person project group (me + 1) to take the lead:
@germanny
germanny / guarding-protocol.md
Last active August 29, 2015 13:56
Protocol for working with dogs who guard

Guarding Protocol

Intro

Guarding (aka, possession aggression or resource guarding) is a natural instinct that is stronger in some dogs than others. It doesn't mean there's anything wrong or unusual about your dog. Your dog is not trying to dominate you or take control of your relationship. Guarding is only a problem for humans. Dogs who can guard and hang on to their possessions are more successful dogs.

Protocol

The most effective and safe way to work through guarding is a 4-part plan:

  1. Management: Do not take things away from your dog. Avoid leaving items your dog will guard out for her to find on her own. Do not allow her to take possession of items she will guard.
@germanny
germanny / missing-slashes.md
Created February 28, 2014 16:40
Missing trailing slashes in WP
@germanny
germanny / page-parent-id.php
Created March 4, 2014 20:59
get page parent in wp-admin
<?php
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
$parents = get_post_ancestors( $post_id );
$id = ($parents) ? $parents[count($parents)-1]: $post_id;
$parent = get_page( $id );
if ( get_id_by_page_name('states') == $parent->ID ) {
// do stuff
}
?>
@germanny
germanny / get_id_by_page_name.php
Last active August 29, 2015 13:57
why does this fail?
<?php
/**
* Get a Page's ID by post_name (slug)
*/
function get_id_by_page_name($post_name) {
global $wpdb;
$post_name_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$post_name."'");
if ( ( $post_name_id !== NULL ) || ( $post_name_id !== '0' ) ) {
return $post_name_id;
}
@germanny
germanny / fn-display-thumbnail.php
Last active August 29, 2015 13:57
[WIP] Display the post thumbnail, if it exists
<?php
function display_post_thumbnail_src( $id = 0 ) { //get the src of image
$post = get_post( $id );
$post_id = isset( $post->ID ) ? $post->ID : 0;
$atturl = '';
$featured_image = '';
$images = '';
$size = 'thumbnail';
@germanny
germanny / 0_reuse_code.js
Created August 6, 2014 18:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@germanny
germanny / content-kitchen-sink.html
Created March 13, 2012 20:25 — forked from ericrasch/content-kitchen-sink.html
HTML Kitchen Sink (taken from BlueTrip CSS Framework) includes the major (and minor) HTML tags you might use on any given site.
<h1>Level 1 heading</h1>
<p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h1 class="fancy">Level 1 heading class="fancy"</h1>
<p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h1 class="thin">Level 1 heading class="thin"</h1>