Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding stuff

Alexandre ELISÉ alexandreelise

💻
Coding stuff
View GitHub Profile
@alexandreelise
alexandreelise / jj.sh
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.
View jj.sh
#!/usr/bin/env bash
RELEASE='3.9'
if [[ -z "$1" ]]; then
exit 1;
fi
PROJECT_NAME="$1"
if [[ ! -z "$2" ]]; then
@alexandreelise
alexandreelise / all.php
Created Jul 19, 2020
Tiny php script to show all available JFormFields in Joomla! 3
View all.php
<?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 / install-php74.sh
Last active Mar 7, 2020
Install php7.4 on Debian based machines. But first need to add ondrej/php ppa or source list file.
View install-php74.sh
#!/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 / install-gcc-9.sh
Created Mar 7, 2020
Install gcc 9 on Ubuntu LTS 12.04,14.04,16.04 and 18.04
View install-gcc-9.sh
#!/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
alexandreelise / auto-upgrade-outdated-brew-formulas.sh
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.
View auto-upgrade-outdated-brew-formulas.sh
#!/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.
View keybase.md

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 / 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">
<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>
@alexandreelise
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="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 / 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
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
<?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
You can’t perform that action at this time.