Skip to content

Instantly share code, notes, and snippets.

View alexandreelise's full-sized avatar
👋
Hello Super Joomlers!

Mr Alexandre J-S William ELISÉ alexandreelise

👋
Hello Super Joomlers!
View GitHub Profile

One-liner to use plausible.io Web Analytics on your Joomla Website

Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager()->registerAndUseScript('plausible-io', 'https://plausible.io/js/script.js', [], ['defer' => true, 'data-domain' => \Joomla\CMS\Uri\Uri::getInstance()->getHost()], []);

WHY

Scratched my own itch. Thought it might be useful to you too.

@alexandreelise
alexandreelise / README.md
Last active February 7, 2024 07:18
Install gcc 9 on Ubuntu LTS 12.04,14.04,16.04 and 18.04

Hi! gcc users

There is good news for you. I made a new repository with a single Dockerfile to build every combinations of versions of Ubuntu LTS and gcc you like

Find out more on https://github.com/alexandreelise/install-gcc

@alexandreelise
alexandreelise / tinyhungryfoodie.php
Last active October 7, 2023 19:41
Tiny hungry foodie php script
<?php
/**
* Tiny hungry foodie php script
*
* @package tinyhungryfoodie
* @author Mr Alexandre J-S William ELISÉ <code@apiadept.com>
* @copyright (c) 2009 - present . Mr Alexandre J-S William ELISÉ . Tous droits réservés.
* @license MIT
* @link https://apiadept.com
*/
@alexandreelise
alexandreelise / tinyhungryfoodie.kt
Last active October 7, 2023 19:40
Tiny hungry foodie kotlin script originally written in PHP
/**
* Tiny hungry foodie kotlin script
*
* @package tinyhungryfoodie
* @author Mr Alexandre J-S William ELISÉ <code@apiadept.com>
* @copyright (c) 2009 - present . Mr Alexandre J-S William ELISÉ . Tous droits réservés.
* @license MIT
* @link https://apiadept.com
*/
fun main() {
@alexandreelise
alexandreelise / tinyhungryfoodie.swift
Last active October 7, 2023 19:39
Tiny hungry foodie Swift script. Originally made in PHP.
/**
* Tiny hungry foodie swift script
*
* @package tinyhungryfoodie
* @author Mr Alexandre J-S William ELISÉ <code@apiadept.com>
* @copyright (c) 2009 - present . Mr Alexandre J-S William ELISÉ . Tous droits réservés.
* @license MIT
* @link https://apiadept.com
*/
var food: String? = "water"
@alexandreelise
alexandreelise / tinyhungryfoodie.c
Last active October 7, 2023 19:37
Tiny foodie hungry script now in C too. Originally in PHP.
/**
* Tiny hungry foodie c script
*
* @package tinyhungryfoodie
* @author Mr Alexandre J-S William ELISÉ <code@apiadept.com>
* @copyright (c) 2009 - present . Mr Alexandre J-S William ELISÉ . Tous droits réservés.
* @license MIT
* @link https://apiadept.com
*/
#include <stdio.h>
@alexandreelise
alexandreelise / README.md
Last active May 29, 2023 21:19
Render All Joomla! 4 Standard Form Fields

j4xall

Render All Joomla! 4 Standard Form Fields using a article layout override. To make it work, you can put this the j4xall.php file at this location:


JPATH_ROOT/templates/cassopeia/html/com_content/article/j4xall.php

@alexandreelise
alexandreelise / error.php
Last active May 13, 2023 14:44
Handle Joomla 404 errors gracefully in 5 lines of code: Fr: Redirection erreur 404 vers un article Joomla en 5 lignes de code / En: Redirect incoming 404 errors to custom Joomla article in 5 lines of code
<?php
/** Redirection vers article personnalisé */
if ($this->error->getCode() == 404) {
header(sprintf('Location: %s', \Joomla\CMS\Router\Route::_('index.php?option=com_content&view=article&id=64', false, \Joomla\CMS\Router\Route::TLS_FORCE, true)));
exit(0);
}
@alexandreelise
alexandreelise / create-joomla-article-from-streamed-csv-with-raw-php-using-joomla4x-api.php
Last active October 8, 2022 15:58
Create an article in Joomla from streamed csv with raw php using Joomla! 4.x Web Services Api
<?php
declare(strict_types=1);
/*
YOUR ATTENTION PLEASE. THE NEW PLACE FOR THIS CODE IS : https://github.com/alexandreelise/j4x-api-examples
*/
/**
@alexandreelise
alexandreelise / plg_fields_articles_layout_title.php
Created October 2, 2022 19:33
Quick fix on line 29 to prevent error from happening when using this plugin with Joomla! 4.x Webservices Api. Fix made for one of my Super Joomler friends: Custom King.
<?php
/**
* @package Articles Field
* @version 3.9.0
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://regularlabs.com
* @copyright Copyright © 2022 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/