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
@julienbourdeau
julienbourdeau / Note.md
Created May 23, 2017 17:17
[Magento2] Make sure image are served from /pub/media AND /media

If you use Magento from the root dir you might want to make sure all your images url are valid. There are some known issue with this but it's generally considered a good practice.

Maybe you have image path like example.com/pub/media/image.png instead of example.com/media/image.png.

The best way to fix this is to tell your server to ignore the /pub in the URLs. Do not set redirection!

Find above the lines to add to your server configuration.

@julienbourdeau
julienbourdeau / regenerate-images.php
Created August 29, 2016 14:12 — forked from matchaxnb/regenerate-images.php
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()
@julienbourdeau
julienbourdeau / boilerplate.html
Last active October 4, 2021 07:58
Best HTML boilerplate from @mmatuzo
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Unique page title - My Site</title>
<script type="module">
document.documentElement.classList.remove('no-js');
@julienbourdeau
julienbourdeau / utils.sh
Created January 27, 2016 17:43
bash helper functions
#!/bin/bash
#
# Set Colors
#
bold=$(tput bold)
underline=$(tput sgr 0 1)
reset=$(tput sgr0)
@julienbourdeau
julienbourdeau / setup.sh
Created January 14, 2021 19:08
New jetstream application
laravel new secret-project
composer require laravel/jetstream
php artisan jetstream:install livewire --teams
composer require barryvdh/laravel-debugbar --dev
@julienbourdeau
julienbourdeau / deploy.sh
Created November 14, 2020 08:03
Rebuild assets and deploy on Laravel Forge
#!/usr/local/bin/bash
# function e_header() { printf "\n${yellow}========== %s ==========${reset}\n" "$@" }
# function e_arrow() { printf "➜ $@\n" }
# TODO: Check if current branch is `master`
e_header "Rebuilding assets"
echo
@julienbourdeau
julienbourdeau / .php_cs
Last active November 8, 2020 19:14
Minimalist PHP CS Fixer config for Laravel
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__.'/app',
__DIR__.'/tests',
])
;
$rulesToDisable = [
@julienbourdeau
julienbourdeau / app.yml.md
Created September 16, 2018 18:04
Discourse config for outter Nginx (run other websites next to Discourse)
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
@julienbourdeau
julienbourdeau / kimsufi-notifier.php
Created August 13, 2017 05:34
Kimsufi notifier
<?php
$url = "https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2?callback=Request.JSONP.request_map.request_0";
$content = file_get_contents($url);
$content = substr($content, strlen("Request.JSONP.request_map.request_0("));
$content = substr($content, 0, strlen($content) - 2);
$content = json_decode($content);
@julienbourdeau
julienbourdeau / CreateUserCommand.php
Created June 28, 2020 16:40
Laravel Create User Command
<?php
namespace App\Console\Commands\Dev;
use App\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
class CreateAdminUserCommand extends Command