Skip to content

Instantly share code, notes, and snippets.

🐝
Tinkering with @betagouv

Raphaël Huchet rap2hpoutre

View GitHub Profile
@rap2hpoutre
rap2hpoutre / squash.md
Last active May 16, 2017
I want to squash the 3 last commits of my branch
View squash.md

I want to squash the 3 last commits of my branch

  1. Checkout the branch: git checkout my-branch
  2. git rebase -i HEAD~3 (3 is the total number of commit you want to squash in one including the one you want to keep)
  3. Replace all pick occurrence but the first by squash (then save)
  4. Delete all message lines but the first (then save)
  5. git push origin my-branch --force

Create an alias to make it easier

Run:

@rap2hpoutre
rap2hpoutre / v0.sh
Last active Apr 26, 2017
Run this command in your "node_modules" directory
View v0.sh
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)")}'
View webpack.mix.js
// ...
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 Jan 30, 2019
Laravel 5.4: migrate from gulp to webpack
View gup-to-webpack.md
  • 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 Jan 4, 2017
music to video (ffmpeg command for youtube)
View script.sh
ffmpeg -loop 1 -i img.png -i music.mp3 -shortest -c:v libx264 -c:a copy video.mkv
@rap2hpoutre
rap2hpoutre / example
Last active Aug 30, 2017
Procedural drum loops
View example
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
View gitup.sh
git config --global alias.up '!git fetch && git rebase --autostash FETCH_HEAD'
@rap2hpoutre
rap2hpoutre / circle.yml
Created May 19, 2016
Circle CI example for Laravel
View circle.yml
machine:
timezone:
Europe/Paris
php:
version: 7.0.3
environment:
ENVIRONMENT: testing
DB_URL: 127.0.0.1
@rap2hpoutre
rap2hpoutre / guzzle.php
Last active Jun 21, 2017
One line guzzle for json rest api
View guzzle.php
<?php
$a = json_decode((new GuzzleHttp\Client())->get('https://api.github.com/user')->getBody(), true);
@rap2hpoutre
rap2hpoutre / laravel-forge-deploy.sh
Last active Apr 16, 2019
Laravel Forge deploy script without downtime
View laravel-forge-deploy.sh
# 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
You can’t perform that action at this time.