Skip to content

Instantly share code, notes, and snippets.

View rap2hpoutre's full-sized avatar

Raphaël Huchet rap2hpoutre

View GitHub Profile
@rap2hpoutre
rap2hpoutre / v0.sh
Last active April 26, 2017 21:59
Run this command in your "node_modules" directory
npm list | grep "@0" | wc -l | awk '{print($1" v0 modules found. According to semver, anything may change at any time (http://semver.org/\#spec-item-4)")}'
// ...
let webpack = require("webpack");
mix.webpackConfig({
plugins: [
// Choose the language you want to keep (Ex: "fr")
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /fr/)
]
});
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active November 22, 2023 00:30
Laravel 5.4: migrate from gulp to webpack
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
@rap2hpoutre
rap2hpoutre / script.sh
Created January 4, 2017 14:22
music to video (ffmpeg command for youtube)
ffmpeg -loop 1 -i img.png -i music.mp3 -shortest -c:v libx264 -c:a copy video.mkv
@rap2hpoutre
rap2hpoutre / example
Last active August 30, 2017 00:15
Procedural drum loops
kicks = "D:/Sound/procedural/kicks"
snares = "D:/Sound/procedural/snares"
hh = "D:/Sound/procedural/hats/"
ohh = "D:/Sound/procedural/ohats/"
rides = "D:/Sound/procedural/rides/"
crashes = "D:/Sound/procedural/crashes/"
use_random_seed 401492
define :crash do
git config --global alias.up '!git fetch && git rebase --autostash FETCH_HEAD'
@rap2hpoutre
rap2hpoutre / circle.yml
Created May 19, 2016 09:22
Circle CI example for Laravel
machine:
timezone:
Europe/Paris
php:
version: 7.0.3
environment:
ENVIRONMENT: testing
DB_URL: 127.0.0.1
@rap2hpoutre
rap2hpoutre / guzzle.php
Last active June 21, 2017 08:15
One line guzzle for json rest api
<?php
$a = json_decode((new GuzzleHttp\Client())->get('https://api.github.com/user')->getBody(), true);
@rap2hpoutre
rap2hpoutre / laravel-forge-deploy.sh
Last active March 28, 2024 15:45
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@rap2hpoutre
rap2hpoutre / gist:54503147e8bbd1abfa6d
Created March 9, 2015 09:20
Log every query in laravel
// Add this in boot method of EventServiceProvider
if (!\App::runningInConsole()) {
\DB::listen(
function ($sql, $bindings, $time) {
\Log::info('QUERY', [$sql, $bindings, $time]);
}
);
}