Skip to content

Instantly share code, notes, and snippets.

diff --recursive -u the-events-calendar-orig/lib/the-events-calendar.class.php the-events-calendar/lib/the-events-calendar.class.php
--- the-events-calendar-orig/lib/the-events-calendar.class.php 2012-12-11 00:35:12.000000000 +0100
+++ the-events-calendar/lib/the-events-calendar.class.php 2012-12-26 16:53:00.000000000 +0100
@@ -1461,6 +1461,7 @@
$newRules[$base . $upcoming] = 'index.php?post_type=' . self::POSTTYPE . '&eventDisplay=upcoming';
$newRules[$base . $past . '/page/(\d+)'] = 'index.php?post_type=' . self::POSTTYPE . '&eventDisplay=past&paged=' . $wp_rewrite->preg_index(1);
$newRules[$base . $past] = 'index.php?post_type=' . self::POSTTYPE . '&eventDisplay=past';
+ $newRules[$base . '(\d{4})$'] = 'index.php?post_type=' . self::POSTTYPE . '&eventDisplay=year' .'&eventDate=' . $wp_rewrite->preg_index(1);
$newRules[$base . '(\d{4}-\d{2})$'] = 'index.php?post_type=' . self::POSTTYPE . '&eventDisplay=month' .'&eventDate=' . $wp_rewrite->preg_index(1);
$newRules[$base . '(\d{4}-\d{2}
@ockham
ockham / noenddate.patch
Created December 26, 2012 17:55
Patch against 2.0.10 to only display end time in The Events Calendar widget if end date is equal begin date. (German) example: 4. Februar 2013 19:00 – 22:00 instead of previously 4. Februar 2013 19:00 – 4. Februar 2013 22:00
--- the-events-calendar/public/template-tags/date.php 2012-12-26 13:57:11.000000000 +0100
+++ date.php 2012-12-26 18:32:36.000000000 +0100
@@ -57,7 +57,7 @@
* @todo support $postId for recurring events.
* @since 2.0
*/
- function tribe_get_end_date( $postId = null, $displayTime = 'true', $dateFormat = '' ) {
+ function tribe_get_end_date( $postId = null, $displayTime = 'true', $dateFormat = '', $displayDate = true ) {
$postId = TribeEvents::postIdHelper( $postId );
if (!$postId || ( function_exists('tribe_is_recurring_event') && tribe_is_recurring_event( $postId ) ) ) {
<?php
/**
* Date Functions
*
* Display functions (template-tags) for use in WordPress templates.
*/
// Don't load directly
if ( !defined('ABSPATH') ) { die('-1'); }
@ockham
ockham / numbers.patch
Created December 29, 2012 20:48
I've produced a patch that enables a `numbers` option to the [alphabet] shortcode which defaults to 'true', but when set to false, makes the shortcode result in displaying only letters, not numbers, i.e. ABCDEFGHIJKLMNOPQRSTUVWXYZ instead of 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ I've also simplified generation of numbers and letters by usage of r…
Gemeinsame Unterverzeichnisse: my-content-management/images und my-content-management-nums/images.
Gemeinsame Unterverzeichnisse: my-content-management/lang und my-content-management-nums/lang.
diff -u my-content-management/my-content-management.php my-content-management-nums/my-content-management.php
--- my-content-management/my-content-management.php 2012-10-27 20:27:18.000000000 +0200
+++ my-content-management-nums/my-content-management.php 2012-12-29 21:27:34.000000000 +0100
@@ -700,7 +700,7 @@
if ( $value == 'mcm_glossary' && function_exists('mcm_set_glossary') ) { $extension = "<h4>Glossary Extension</h4>
<p>".__('The glossary extension to My Content Management is enabled.','my-content-management')."</p>
<ul>
- <li><code>[alphabet]</code>: ".__('displays list of linked first characters represented in your Glossary. (Roman alphabet only.)','my-content-management')."</li>
@ockham
ockham / edit-link.patch
Created January 13, 2013 15:40
Patch to enable addition of an Edit post link to custom types as added by the Wordpress "My Content Management" plugin. (Tested with glossary terms.)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE gourmetDoc>
<gourmetDoc>
<recipe id="2283">
<title>Peach Coffee Cake II</title>
<source>Cookin_Queen, HOMESCHOOLMUMMYX3, ALL RIGHTS RESERVED © 2012 Allrecipes.com Printed from Allrecipes.com 9/9/2012</source>
<link>http://allrecipes.com/Recipe-Tools/Print/Recipe.aspx?RecipeID=87959&amp;origin=detail&amp;&amp;Servings=16</link>
<preptime>20 minutes</preptime>
<cooktime>45 minutes</cooktime>
<yields>16 servings</yields>
diff --git a/gourmet/plugins/import_export/pdf_plugin/pdf_exporter.py b/gourmet/plugins/import_export/pdf_plugin/pdf_exporter.py
index e9fb2c1..f77cc7c 100644
--- a/gourmet/plugins/import_export/pdf_plugin/pdf_exporter.py
+++ b/gourmet/plugins/import_export/pdf_plugin/pdf_exporter.py
@@ -4,6 +4,8 @@ from reportlab.lib.units import inch,mm
import reportlab.platypus as platypus
import reportlab.lib.pagesizes as pagesizes
import reportlab.lib.styles as styles
+from reportlab.pdfbase import pdfmetrics
+from reportlab.pdfbase.ttfonts import TTFont
@ockham
ockham / gist:e0535a12792eed4f525e
Created August 27, 2014 09:23
php index.php output
<!DOCTYPE html>
<!--[if lt IE 7]><html class="ng-csp ie ie6 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]-->
<!--[if IE 7]><html class="ng-csp ie ie7 lte9 lte8 lte7" data-placeholder-focus="false"><![endif]-->
<!--[if IE 8]><html class="ng-csp ie ie8 lte9 lte8" data-placeholder-focus="false"><![endif]-->
<!--[if IE 9]><html class="ng-csp ie ie9 lte9" data-placeholder-focus="false"><![endif]-->
<!--[if gt IE 9]><html class="ng-csp ie" data-placeholder-focus="false"><![endif]-->
<!--[if !IE]><!--><html class="ng-csp" data-placeholder-focus="false"><!--<![endif]-->
<head data-requesttoken="6327047a74188b3ea8d8">
<title>
<?php
$CONFIG = array (
'passwordsalt' => 'a75f26f303939f273b6b7f60029b40',
'trusted_domains' =>
array (
0 => NULL,
),
'datadirectory' => '/home/bernie/src/owncloud/core/data',
'dbtype' => 'sqlite',
'version' => '7.8.0.0',
@ockham
ockham / gist:09845e12d48d0d7bc258
Created December 3, 2014 16:50
An example PhpParser\Node
[2] => PhpParser\Node\Expr\FuncCall Object
(
[subNodes:protected] => Array
(
[name] => PhpParser\Node\Name Object
(
[subNodes:protected] => Array
(
[parts] => Array
(