Skip to content

Instantly share code, notes, and snippets.

Coding stuff

Alexandre ELISÉ alexandreelise

Coding stuff
View GitHub Profile
alexandreelise /
Last active Aug 8, 2020
jj is a bash script wrapper around the amazing joomlatools/console composer package. It assumes that you already created a self-signed wildcard certitificate in /opt/selfsigned/*.sites.test directory for linux users. For macOS users adapt the script to your environment.
#!/usr/bin/env bash
if [[ -z "$1" ]]; then
exit 1;
if [[ ! -z "$2" ]]; then
alexandreelise / all.php
Created Jul 19, 2020
Tiny php script to show all available JFormFields in Joomla! 3
View all.php
* @package all
* @author Alexandre ELISÉ <>
* @link
* @copyright (c) 2020 . Alexandre ELISÉ . Tous droits réservés.
* @license GPL-2.0-and-later GNU General Public License v2.0 or later
* Created Date : 19/07/2020
* Created Time : 16:04
alexandreelise /
Last active Mar 7, 2020
Install php7.4 on Debian based machines. But first need to add ondrej/php ppa or source list file.
#!/usr/env sh
# To add this repository please do:
if [ "$(whoami)" != "root" ]; then
${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl \
&& ${SUDO} wget -O /etc/apt/trusted.gpg.d/php.gpg \
&& ${SUDO} sh -c "echo \"deb$(lsb_release -si | awk '{print tolower($0)}' ) $(lsb_release -sc) main\" > /etc/apt/sources.list.d/php.list" \
alexandreelise /
Created Mar 7, 2020
Install gcc 9 on Ubuntu LTS 12.04,14.04,16.04 and 18.04
#!/usr/bin/env sh
sudo apt-get update -y && \
sudo apt-get upgrade -y && \
sudo apt-get dist-upgrade -y && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update -y && \
sudo apt-get install gcc-9 g++-9 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 && \
alexandreelise /
Created Jan 22, 2020
An attempt to automate the upgrade of outdated homebrew formulas all at once. Do this at your own risk. Understand what it does before running it.
#Take just the outdated formulas names from the list using awk
#then give that to upgrade command
# you could add to this line && brew cleanup but it's up to you
# WARNING: Please understand what that script does before using it.
# I will in no way be responsible for the misuse of this script.
# If you understand and you are ok with that, If you are unsure don't use it.

Keybase proof

I hereby claim:

  • I am alexandreelise on github.
  • I am mralexandrelise ( on keybase.
  • I have a public key ASDmY-nGMO4ghAQFh0Tv_htLmCtrxlif89vZ6stm4NxWfQo

To claim this, I am signing this object:

alexandreelise / modularsqlexample.xml
Created Jan 5, 2020
Example Joomla! component with separated install SQL files running in order presented in this manifest file
View modularsqlexample.xml
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.9" method="upgrade" client="administrator">
<copyright>(C) example. All rights reserved.</copyright>
alexandreelise / using-akeeba-backup-pro-api-in-custom-joomla-extension.php
Created Jan 3, 2020
How to use Akeeba Backup Pro JSON API in your own Joomla! extensions
View using-akeeba-backup-pro-api-in-custom-joomla-extension.php
* Encodes the method parameters in a way that our remote API understands
* @param string $method Which method of the remote API to use
* @param array $params A key=>value array with the method's parameters
* @param string $component [optional] Receiving component. Skip to use com_akeeba.
* @return array
* @see <a href=""></a> at line 148
alexandreelise / joomla-3-user-login-by-code.php
Created Dec 2, 2019
Joomla! 3 user login programmatically using a simple php snippet
View joomla-3-user-login-by-code.php
* @var bool $result_login true on successful login, false otherwise
$result_login = Factory::getApplication()->login(
'username' => 'example',
'password' => 'mysupersecretpassword'
'remember' => true,
alexandreelise / add-custom-fields-to-core-modules-j3x.php
Created Nov 26, 2019
Add custom fields to core modules in Joomla! 3
View add-custom-fields-to-core-modules-j3x.php
defined('_JEXEC') or die;
<div class="latestnews">
<ul class="list-group list-group-flush">
<?php foreach ($list as $item) : $image = json_decode($item->images); ?>
// most important part
// context:
// for articles: com_content.article
You can’t perform that action at this time.