Skip to content

Instantly share code, notes, and snippets.

View julienbourdeau's full-sized avatar
🏠
Working from home

Julien Bourdeau julienbourdeau

🏠
Working from home
View GitHub Profile
@tdd
tdd / gist:fb863904b337347cabde
Created June 19, 2014 08:49
Prompt PS1 Bash Git avec les couleurs
export PS1='\[\e[0;36m\][\A] \u@\h:\[\e[0m\e[0;32m\]\W\[\e[1;33m\]$(__git_ps1 " (%s)")\[\e[0;37m\] \$\[\e[0m\]'
@micahwalter
micahwalter / .gitignore
Created August 18, 2010 03:35 — forked from redoPop/.gitignore
wordpress .gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@julienbourdeau
julienbourdeau / spriteHelpers.less
Created October 13, 2012 11:44
Sprite with LESScss from smashing mag
.spriteHelper(@image, @x, @y, @spriteX, @spriteY) {
background: url("img/@{image}.png") no-repeat;
background-position: -(@x*@spriteX) -(@y*@spriteY);
}
.sprite(@image, @x, @y) when (@image = sprite1), (@image = sprite3){
@spriteX: 32px;
@spriteY: 16px;
.spriteHelper(@image, @x, @y, @spriteX, @spriteY);
}
.sprite(@image, @x, @y) when (@image = sprite2){
@firstred
firstred / form.tpl
Created July 1, 2016 07:17
Form.tpl 1.5 backwards compatibility
{extends file="helpers/form/form.tpl"}
{block name="input"}
{if $input.type == 'switch' && $smarty.const._PS_VERSION_|@addcslashes:'\'' < '1.6'}
{foreach $input.values as $value}
<input type="radio" name="{$input.name|escape:'htmlall':'UTF-8'}"
id="{$input.name|escape:'htmlall':'UTF-8'}_{$value.id|escape:'htmlall':'UTF-8'}"
value="{$value.value|escape:'htmlall':'UTF-8'}"
{if $fields_value[$input.name] == $value.value}checked="checked"{/if}
{if isset($input.disabled) && $input.disabled}disabled="disabled"{/if} />
<?php
/**
* Ajax entry
*
* @category Prestashop
* @category Module
* @author Samdha <contact@samdha.net>
* @copyright Samdha
* @license commercial license see license.txt
*/
@firstred
firstred / index.js
Last active August 4, 2016 14:06
PrestaShop - Generate country names
var builder = require('xmlbuilder');
var filewalker = require('filewalker');
var prestashop_langs_dir = './langs'; // Relative or absolute path to language folder in install dir
var cldr_data = './node_modules/cldr-data'; // Cldr data location
var _ = require('lodash');
var fs = require('fs');
var missing_langs = [];
var found_langs = [];
var filewalking_done = false;
var analyzing_dirs = 0;
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `newpresta17`.`ps_accessory` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_address` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_address_format` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_alias` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_attachment` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_attachment_lang` ;
DROP TABLE IF EXISTS `newpresta17`.`ps_attribute` ;
function interceptFunction (object, fnName, options) {
var noop = function () {};
var fnToWrap = object[fnName];
var before = options.before || noop;
var after = options.after || noop;
object[fnName] = function () {
before.apply(this, arguments);
var result = fnToWrap.apply(this, arguments);
after.apply(this, arguments);
@julienbourdeau
julienbourdeau / GeoSearchable.php
Last active July 13, 2017 19:53
Add geolocalization capability to Laravel Scout (with Algolia engine)
<?php
namespace App\Search;
/**
* This trait must be used next to the Laravel\Scout\Searchable trait
*
*/
trait GeoSearchable
{
@djfm
djfm / foreach_submodule.js
Last active March 30, 2018 09:06
Execute git submodule foreach... in parallel! Useful for PrestaShop development :)
#!/usr/bin/nodejs
var fs = require('fs');
var spawn = require('child_process').spawn;
function parseSubmodules(data) {
var lines = data.split(/\n+/);
var modules = {};
var currentPath;