Skip to content

Instantly share code, notes, and snippets.

View xymox12's full-sized avatar

euanjfc xymox12

View GitHub Profile
@xymox12
xymox12 / notes to self on template inside plugin
Created February 10, 2014 22:25
notes to self on template inside wordpress plugin
------------------------------------------------------------
public $pluginPath;
public function include_template_files($template) {
//global $wp;
if (is_tax( 'cp_keywords' )) {
$templatefilename = 'taxonomy-cp_keywords.php';
$template = $this->pluginPath . '/templates/' . $templatefilename;
echo $template;
@xymox12
xymox12 / columnFilter plugin
Created January 23, 2014 22:03
Datables notes
https://code.google.com/p/jquery-datatables-column-filter/wiki/ColumnFilter
.columnFilter({
sPlaceHolder: "head:before",
aoColumns: // Uses column order rather than class :(
[
{sSelector: "#titleFilter", type: "text"},
{sSelector: "#journalFilter", type: "select"},
{sSelector: "#abstractFilter", type: "text"},
@xymox12
xymox12 / gist:8089380
Created December 22, 2013 22:47
wordpress custom query
SELECT wp002_posts.post_title,
wp002_posts.post_name,
wp002_posts.post_type,
wp002_postmeta.meta_value,
wp002_pure_profiles_publication.title,
wp002_posts.post_status,
wp002_pure_profiles_publication.abstract,
wp002_pure_profiles_publication.dois,
wp002_pure_profiles_publication.numberofpages,
wp002_pure_profiles_publication.publicationyear,
@xymox12
xymox12 / functions.php
Created November 21, 2013 23:02
Modify multiple tinymce's on the same Advanced Custom Field post type (in this case post_type == 'fellow')
/* Tiny MCE Modifications */
function emy_refresh_mce($ver) {
++$ver; // or $ver .= 3; or ++$ver; etc.
return $ver;
}
add_filter('tiny_mce_version', 'emy_refresh_mce');
function myformatTinyMCE($in) {
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ical="http://www.ietf.org/rfc/rfc2445.txt"
xmlns:itip="http://www.ietf.org/rfc/rfc2446.txt"
xmlns="http://www.ietf.org/rfc/rcf2445.txt">
<!-- ======================================================================== -->
<!-- ics2xml.xsl XSL transformation of iCalendar .ics file to XML file -->
<!-- Tim Hare, November 2006 -->
<!-- This transformation may be freely used, attribution is appreciated -->
<?php
class EO_Shortcode_Grouped_Lists extends EventOrganiser_Shortcodes {
static function init() {
add_shortcode('eo_group_events_by_date', array(__CLASS__, 'handle_eventlist_shortcode'));
}
// Modified copy of orginal handle_eventlist_shortcode
static function handle_eventlist_shortcode($atts = array(), $content = null) {
@xymox12
xymox12 / group-by-date.php
Created November 17, 2013 17:53
Event organiser - useful scripts
<?php $day_check = ''; /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php $day = eo_get_the_start('jS M Y');
if ($day != $day_check) {
if ($day_check != '') {
echo '</ul>'; // close the list here
}
echo eo_get_the_start('jS M Y') . '<ul>';
}
?>
@xymox12
xymox12 / excel.vb
Created September 26, 2013 13:04
Script I found online to move a html table in an email body into a excel spreadsheet. Not my own, Original Author: John_w http://www.ozgrid.com/forum/showthread.php?t=176467
Option Explicit
Public Sub Import_Survey_Emails()
Dim outApp As Outlook.Application
Dim outNs As Outlook.Namespace
Dim outFolder As Outlook.MAPIFolder
Dim outMail As Outlook.MailItem
Dim lastRow As Long
Dim destCell As Range
@xymox12
xymox12 / mysql2xml.php
Last active December 22, 2015 16:39
openconf query
SELECT paper.title,
GROUP_CONCAT(CONCAT('{{',
author.name_first,
'}}{{',
author.name_last,
'}}'))
AS names,
paper.abstract,
topic.topicname,
paper.paperid
@xymox12
xymox12 / Consolas-for-powerline-mod.md
Last active December 16, 2015 20:19
Config files for using eugeneching / consolas-powerline-vim Font and the new Powerline