Skip to content

Instantly share code, notes, and snippets.

View jbanety's full-sized avatar

Jean-Baptiste Alleaume jbanety

View GitHub Profile
@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
{%- 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 / 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();
<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 / 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
@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 / build_pcntl.sh
Last active February 6, 2024 02:50
(Updated) Build PCNTL ext for MAMP PHP 7.4.2
#!/bin/bash
PHP_VERSION=7.4.2
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl lzlib curl imap-uw readline postgresql gettext libxslt libiconv bison pkg-config krb5 bzip2 openldap tidy-html5
# Dirs
@jbanety
jbanety / build_memcache_php7_mamp.sh
Created August 25, 2016 15:19
Build Memcache PHP7 Ext
brew install pkg-config libmemcached
git clone https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached/
git checkout php7
/Applications/MAMP/bin/php/php7.0.8/bin/phpize
./configure --disable-memcached-sasl --with-libmemcached-dir=/usr/local/opt/libmemcached
make
make install
echo "extension=memcached.so" >> /Applications/MAMP/bin/php/php7.0.8/conf/php.ini
@jbanety
jbanety / create_labels.sh
Last active December 8, 2016 17:43 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/bin/env bash
###
# Label definitions
###
declare -A LABELS
# Plateforme
LABELS["framework"]="BFD4F2"
LABELS["app"]="BFD4F2"
@jbanety
jbanety / boum.css
Last active February 8, 2017 17:09
h2:before {
display: block;
position: absolute;
left: -1050px;
top: 50%;
background-color: #ecc873;
height: 1px;
width: 1000px;
margin-top: -0.5px;
content: " ";