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 / 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_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: " ";
@jbanety
jbanety / sitemap.php
Created February 21, 2017 10:06
Fake sitemap.xml
<?php
header('Content-Type: text/xml; charset=utf-8');
echo file_get_contents("http://[WEBSITEURL]/index.php?option=com_osmap&view=xml&id=1");
@jbanety
jbanety / .htaccess
Created February 21, 2017 10:08
Fake sitemap.xml
## Mod_rewrite in use.
RewriteEngine On
# Sitemap dynamique
RewriteRule sitemap.xml sitemap.php [L]