Skip to content

Instantly share code, notes, and snippets.

View alexandreelise's full-sized avatar
💡
Your Website. Augmented.

Api Adept alexandreelise

💡
Your Website. Augmented.
View GitHub Profile
@alexandreelise
alexandreelise / add-custom-fields-to-core-modules-j3x.php
Created November 26, 2019 09:23
Add custom fields to core modules in Joomla! 3
<?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); ?>
<?php
// most important part
// context:
// for articles: com_content.article
@alexandreelise
alexandreelise / joomla-3-user-login-by-code.php
Created December 2, 2019 19:30
Joomla! 3 user login programmatically using a simple php snippet
/**
* @var bool $result_login true on successful login, false otherwise
*/
$result_login = Factory::getApplication()->login(
[
'username' => 'example',
'password' => 'mysupersecretpassword'
],
[
'remember' => true,
@alexandreelise
alexandreelise / using-akeeba-backup-pro-api-in-custom-joomla-extension.php
Created January 3, 2020 22:45
How to use Akeeba Backup Pro JSON API in your own Joomla! extensions
/**
* 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="https://github.com/nikosdion/Akeeba-Example/blob/master/application/components/com_akeebaexample/helpers/api.php">https://github.com/nikosdion/Akeeba-Example/blob/master/application/components/com_akeebaexample/helpers/api.php</a> at line 148
*/
@alexandreelise
alexandreelise / modularsqlexample.xml
Created January 5, 2020 20:30
Example Joomla! component with separated install SQL files running in order presented in this manifest file
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.9" method="upgrade" client="administrator">
<name>com_modularsqlexample</name>
<author>example</author>
<creationDate>0000-00-00</creationDate>
<copyright>(C) example. All rights reserved.</copyright>
<license>http://www.gnu.org/copyleft/gpl.html</license>
<authorEmail>modularsql@example.com</authorEmail>
<authorUrl>example.com</authorUrl>
<version>1.0.0</version>

Keybase proof

I hereby claim:

  • I am alexandreelise on github.
  • I am mralexandrelise (https://keybase.io/mralexandrelise) on keybase.
  • I have a public key ASDmY-nGMO4ghAQFh0Tv_htLmCtrxlif89vZ6stm4NxWfQo

To claim this, I am signing this object:

@alexandreelise
alexandreelise / auto-upgrade-outdated-brew-formulas.sh
Created January 22, 2020 07:44
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.
#!/bin/bash
#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.
@alexandreelise
alexandreelise / README.md
Last active October 25, 2024 00:12
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 / install-php74.sh
Last active March 7, 2020 14:58
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=sudo
fi
${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl \
&& ${SUDO} wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \
&& ${SUDO} sh -c "echo \"deb https://packages.sury.org/php/$(lsb_release -si | awk '{print tolower($0)}' ) $(lsb_release -sc) main\" > /etc/apt/sources.list.d/php.list" \
@alexandreelise
alexandreelise / all.php
Last active April 12, 2022 13:20
Tiny php script to show all available JFormFields in Joomla! 3
<?php
/**
* @package all
* @author Alexandre ELISÉ <contact@alexandre-elise.fr>
* @link https://alexandre-elise.fr
* @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
alexandreelise / jj.sh
Last active August 8, 2020 13:38
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
RELEASE='3.9'
if [[ -z "$1" ]]; then
exit 1;
fi
PROJECT_NAME="$1"
if [[ ! -z "$2" ]]; then