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
#!/bin/bash
#Generated by JetBrains Toolbox 2.2.3.20090 at 2024-04-10T10:51:26.013119
declare -a intellij_args=()
declare -- wait=""
for o in "$@"; do
if [[ "$o" = "--wait" || "$o" = "-w" ]]; then
wait="-W"
o="--wait"
@julienbourdeau
julienbourdeau / clean-prestashop-db.sql
Last active March 20, 2024 13:06
Clean PrestaShop database - Drop old and unless data
# Delete all logs
TRUNCATE ps_log;
# Delete old connection data (only used for stats)
# change 2016-02-01 00:00:00 according to you needs
DELETE c, cs
FROM ps_connections c
LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections)
WHERE c.date_add < '2016-02-01 00:00:00';
@julienbourdeau
julienbourdeau / nginx-site.conf
Created January 7, 2024 08:24
Rails on a bare metal server
upstream puma {
server 127.0.0.1:3000;
}
server {
server_name yolo.com;
client_max_body_size 200m;
gzip on;
gzip_comp_level 4;
gzip_min_length 1000;
@julienbourdeau
julienbourdeau / prestashop.conf
Created May 4, 2016 14:23
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
@julienbourdeau
julienbourdeau / commit-message-convention.md
Created May 2, 2016 12:02
The seven rules of a great git commit message

Source: http://chris.beams.io/posts/git-commit/#seven-rules

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how
@julienbourdeau
julienbourdeau / Post.php
Last active June 28, 2023 23:33
Symfony Post entity for Algolia's documentation
<?php
/*
* This file is part of the Symfony/demo project
* https://github.com/symfony/demo
*
*/
namespace App\Entity;
@julienbourdeau
julienbourdeau / webpack.mix.js
Created April 20, 2020 06:43
Laravel Mix with multiple Tailwind config and PurgeCSS (separate Admin dashboard and Front app)
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
const rootPath = Mix.paths.root.bind(Mix.paths);
const tailwindPlugins = function(configFile, paths) {
const pluginList = [tailwindcss(configFile)];
if (mix.inProduction()) {
pluginList.push(require('@fullhuman/postcss-purgecss')({
@julienbourdeau
julienbourdeau / wilson.php
Last active January 11, 2023 05:34
[PHP] 5 Star Rating - Lower bound of Wilson score confidence interval for a Bernoulli parameter
<?php
/*
|--------------------------------------------------------------------------
| 5 Star Rating
|--------------------------------------------------------------------------
|
| Lower bound of Wilson score confidence interval for a Bernoulli parameter (0.9604)
|
| See:
@julienbourdeau
julienbourdeau / GitDetails.php
Created October 22, 2022 08:37
Show current Git hash (as version) with Laravel Blade component
<?php
namespace App\View\Components\Admin;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\Component;
class GitDetails extends Component
{
const REPO = 'julienbourdeau/julienbourdeau.com';
@julienbourdeau
julienbourdeau / gist:a806b65c75fb688a59b9
Created October 6, 2015 15:36
Count commits between to branches/tags (with or without merge commits)
git rev-list --count HEAD ^develop
git rev-list --no-merges --count HEAD ^develop