Skip to content

Instantly share code, notes, and snippets.

View jbanety's full-sized avatar

Jean-Baptiste Alleaume jbanety

View GitHub Profile
@jbanety
jbanety / render_joomla_modules.php
Created June 13, 2016 11:36
Render joomla modules in templates
function _load($position, $style = 'none') {
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$modules = JModuleHelper::getModules($position);
$params = array('style' => $style);
foreach ($modules as $module) {
echo $renderer->render($module, $params);
}
@jbanety
jbanety / upgrade-mamp-php-7.sh
Last active March 13, 2019 04:23
Upgrade MAMP PHP to 7.0.6 with Homebrew formulas
# Brew Formulas
brew update
brew install libpng jpeg lzlib freetype readline openssl imap-uw curl postgresql libxml2 gettext libxslt mcrypt homebrew/dupes/libiconv icu4c expat
# MAMP
mkdir -p /Applications/MAMP/bin/php/php7.0.6/include
cd /Applications/MAMP/bin/php/php7.0.6/include
# Download PHP
wget -O php-7.0.6.tar.bz2 http://fr2.php.net/get/php-7.0.6.tar.bz2/from/this/mirror
<field name="avatarFile"
type="EtdSolutions.File"
class="form-control"
label="FORM_RESIDENT_FIELD_AVATAR_LABEL"
filter="string"
allowedFileExtensions="png,gif,jpg,jpeg,bmp"
accept="image/*"
showRemove="true"
showUpload="true"
dropZoneEnabled="false"
@jbanety
jbanety / gist:d9dee970d4d8a5f6de60
Last active August 29, 2015 14:22
etd upload ajax
/**
* Méthode pour uploader un avatar en AJAX.
*
* @return \stdClass
*/
public function uploadavatar() {
// Init
$result = new \stdClass();
$app = $this->getApplication();
$input = $this->getInput();
{%- set js -%}
jQuery(document).ready(function() {
$('#calendar').fullCalendar({
events: {
url: '{{ uri.base.full }}evenements/load',
type: 'POST',
data: function() {
var data = {
'{{ token }}': '1',
'filters': []
@jbanety
jbanety / clone-repo
Created September 9, 2014 10:08
Cloner un repo avec les submodules
Pour un nouveau repo :
git clone --recursive git://github.com/foo/bar.git
cd bar
Pour les repos déjà clonés :
git clone git://github.com/foo/bar.git
cd bar
git submodule update --init --recursive