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
@purp
purp / delegate_matcher.rb
Last active July 31, 2020 10:46 — forked from bparanj/delegate_matcher.rb
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:day).to(:created_at) }
# it { should delegate(:month, :year).to(:created_at) }
# end
#
@w00fz
w00fz / sphp.sh
Last active February 7, 2022 00:12
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
<?php
/**
* Ajax entry
*
* @category Prestashop
* @category Module
* @author Samdha <contact@samdha.net>
* @copyright Samdha
* @license commercial license see license.txt
*/
@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} />
@mickaelandrieu
mickaelandrieu / upgrade_to_symfony3-lts.md
Last active March 20, 2024 20:16
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.
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` ;
@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;
@julienbourdeau
julienbourdeau / app.txt
Last active June 5, 2019 14:45
[Inspiration] Documentation and Blog themes I like
https://venturecost.com/
@aemonge
aemonge / prepare-commit-msg
Last active March 1, 2024 01:02
Angular Commit Message Conventions git hook, so you got your commit prepared to with the messages they expect ;)
#!/bin/bash
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit ;)
echo '<type>(<component>): <subject>' > .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<body>' >> .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '# types: feat, fix, docs, style, refactor, test, chore(mantean)' >> .prepare-commit-msg-temp
@matchaxnb
matchaxnb / regenerate-images.php
Created May 20, 2015 14:56
Regenerate images in Prestashop from command line
<?php
define('_PS_ROOT_DIR_', '/path/to/prestashop/root');
define('_PS_ADMIN_DIR_', _PS_ROOT_DIR_.'admin_folder');
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(_PS_ADMIN_DIR_.'/functions.php');
class Employee2 extends EmployeeCore
{
public function isSuperAdmin()