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
@alexandreelise
alexandreelise / aej.php
Last active March 11, 2022 12:53
generate random json data structure using a cryptographically secure prng
<?php
declare(strict_types=1);
/**
* A.E Json Jammer (cryptographically secure prng to generate random json data structure)
*
* @package aej
* @author Alexandre ELISÉ <contact@alexapi.cloud>
* @link https://alexapi.cloud
* @copyright (c) 2020 - present. Alexandre ELISÉ. All rights reserved.
* @license MIT
@alexandreelise
alexandreelise / htmlhelper-select-options-with-empty-default.php
Created September 26, 2020 01:03
Code snippet for HTMLHelper select options with empty default value
<label for="demo">Demo</label>
<select id="demo" name="demo">
<?php array_unshift($this->myExampleOptionsArray, null); ?>
<?php echo HTMLHelper::_('select.options', $this->myExampleOptionsArray, 'value', 'text', $this->selectedOptionValue ?? '');?>
</select>
@alexandreelise
alexandreelise / 90-working-setup-php74-cli-xdebug-3-phpstorm.ini
Created December 29, 2020 03:59
After struggling to make it work on the fly I decided to stick to normal setup with only one mode. debug mode. #phpstorm #xdebug3 #php74 might work with php8 also.
[xdebug]
zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.start_upon_error=yes
xdebug.trigger_value=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.connect_timeout_ms=30000
xdebug.force_display_errors=0
@alexandreelise
alexandreelise / force-localhost-site
Created February 21, 2021 21:13
Replace wildcard IPv4 address in your Nginx config files by 127.0.0.1 to try to prevent remote access by internet users to you local dev virtuelhosts
#!/usr/bin/env php
<?php
/**
* This php script attempts to replace wildcard IPv4 address in Nginx sites-available/*.conf files
* by the loopback address 127.0.0.1 to try to prevent access of your local dev environment by Internet
* when listening to all network interface like *:80 or *:443 does. * means listen to all available network
* interfaces and this script tries to restrict use to loopback only.
*
* NOTE: If you have multiple wildcard IPv4 address in your conf files at the moment of writing this script it
* doesn't handle yet this edge case correctly. It just replaces all the wildcard addresses rather than having just one occurence of 127.0.0.1 you will have multiple ones which can cause "address already in use" errors while restart Nginx. Please keep that in mind. You can improve this script at will. It's a first attempt. Hope it helps someone.
@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.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 / 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 / securely_share_gitpod_workspace.txt
Created May 20, 2021 19:28
Code snippet to add in tasks command of gitpod to make it more securely shareable
git config --global --unset-all user.name &&
git config --global --unset-all user.email &&
git config --global --unset-all credential.helper &&
@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