Skip to content

Instantly share code, notes, and snippets.

View vicchi's full-sized avatar

Gary Gale vicchi

View GitHub Profile
@vicchi
vicchi / 04.python
Created March 12, 2014 10:09
Homebrew libxml2 Build Failure
$ cat ~/Library/Logs/Homebrew/libxml2/04.python
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
libxslt stub generator not found, libxslt not built
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
copying libxml2.py -> build/lib.macosx-10.9-intel-2.7
@vicchi
vicchi / custom-loop.php
Created May 10, 2013 13:51
Using WP Biographia template tags within a custom Loop
<?php
/*
Template Name Posts: Desktops
*/
get_header();
?>
<!--sub head container-->
@vicchi
vicchi / page-biographies.php
Created May 10, 2013 08:26
Custom page template, based on the stock Twenty Ten theme, to produce a list of each user's WP Biographia Biography Box followed by that user's latest post. Assumes PHP 5.0 and higher.
<?php
/**
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
* Template Name: Biographies
*/
$fields = array(0 => 'ID', 1 => 'user_login');
$args = array('orderby' => 'nicename', 'fields' => $fields);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mapstraction Text - Microsoft v7</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"></script>
<script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script src="https://raw.github.com/mapstraction/mxn/release-2.1/source/mxn.js?(microsoft7)" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="all" href="css/examples.css">
<style type="text/css">
@vicchi
vicchi / wp-login-security-2-fix.php
Created March 12, 2013 12:12
Workaround for the WP Login Security 2 plugin issuing "session_start(): Cannot send session cache limiter" warnings where the PHP display_errors ini setting can't be changed.
<?php
function wpls2_new_ip_check() {
$error_status = ini_get('display_errors');
if ($error_status === '1') {
ini_set('display_errors', '0');
}
global $wpls2_options, $current_user;
session_start();
$known = get_option( $wpls2_options['whitelist'] );
@vicchi
vicchi / wp-biographia-mailto-subject-filter.php
Created February 25, 2013 09:43
Example of the WP Biographia WordPress plugin's wp_biographia_link_item filter; appends the current post's title to the Biography Box's mailto link. Copy and paste this code into the bottom of your theme's functions.php.
add_filter ('wp_biographia_link_item', 'filter_link_item', 10, 2);
function filter_link_item ($content, $params) {
// $params = array (
// 'type' => 'link type (icon|text)',
// 'format' => 'link format string',
// 'meta' => 'additional anchor attributes',
// 'title' => 'link title',
// 'url' => 'link URL',
// 'body' => 'link body text',
// 'link-class' => 'link CSS class name',
@vicchi
vicchi / avatars.php.diff
Created November 8, 2012 13:54
Add Local Avatars - get_avatar filter patch for avatars.php
1295,1296c1295
< $alt = 'avatar';
<
---
>
1401c1400
< $avatar = "<img src='{$src}' class='{$class} avatar-{$size} avatar-default' height='{$size}' width='{$size}' style='width: {$size}px; height: {$size}px;' alt='{$alt}' />";
---
> $avatar = "<img src='{$src}' class='{$class} avatar-{$size} avatar-default' height='{$size}' width='{$size}' style='width: {$size}px; height: {$size}px;' alt='avatar' />";
1413c1412
@vicchi
vicchi / wp-biographia-widget-debug.php
Created October 13, 2012 08:45
WP Biographia Widget - Debug Version - For v3.2.1 Only
<?php
// WP Biographia Widget
// COMPATIBLE WITH v3.2.1 ONLY - DO NOT USE IN A PRODUCTION ENVIRONMENT
class WP_BiographiaWidget extends WP_Widget {
static $name_options;
private $widget_sem = false;
@vicchi
vicchi / lib.php.diff
Created September 25, 2012 07:44
Easy Heads Up Bar - lib.php.diff
70c70
< $xtra = " AND show_where != 'interior'";
---
> $xtra .= " AND show_where != 'interior'";
72c72
< $xtra = " AND show_where != 'home'";
---
> $xtra .= " AND show_where != 'home'";
180,182d179
@vicchi
vicchi / easy-heads-up-bar.php.diff
Created September 25, 2012 07:43
Easy Heads Up Bar - easy-heads-up-bar.php.diff
58c58
< define( 'EHU_WEB_URL', $ehu_the_web_url );
---
> define( 'EHU_WEB_URL', $ehu_the_web_add );