Skip to content

Instantly share code, notes, and snippets.

@cedriclombardot
cedriclombardot / gist:2871347
Last active February 10, 2021 13:25
Delete git merged branch with confirmation
# List dist branch merged | exclude master, HEAD and develop | remove origin/ | delete remote branch asking confirmation
git branch -r --merged | grep -vw "master" | grep -vw "HEAD" | grep -vw "develop" | sed -e "s/origin\///g" | sed -e 's/^[[:space:]]*//' | xargs -p -I {} git push origin :{}
panic(cpu 0 caller 0xffffff7f81313970): "UPSB(MacBookPro14,3): thunderbolt power on failed 0xffffffff\n"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/IOPCIFamily/IOPCIFamily-370.0.2/IOPCIBridge.cpp:1396
Backtrace (CPU 0), Frame : Return Address
0xffffff81ee693a60 : 0xffffff8000739a3b
0xffffff81ee693ab0 : 0xffffff8000870fe5
0xffffff81ee693af0 : 0xffffff8000862a5e
0xffffff81ee693b40 : 0xffffff80006e0a40
0xffffff81ee693b60 : 0xffffff8000739127
0xffffff81ee693c60 : 0xffffff800073950b
0xffffff81ee693cb0 : 0xffffff8000ed17f9
0xffffff81ee693d20 : 0xffffff7f81313970
panic(cpu 0 caller 0xffffff7f81313970): "UPSB(MacBookPro14,3): thunderbolt power on failed 0xffffffff\n"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/IOPCIFamily/IOPCIFamily-370.0.2/IOPCIBridge.cpp:1396
Backtrace (CPU 0), Frame : Return Address
0xffffff81ee693a60 : 0xffffff8000739a3b
0xffffff81ee693ab0 : 0xffffff8000870fe5
0xffffff81ee693af0 : 0xffffff8000862a5e
0xffffff81ee693b40 : 0xffffff80006e0a40
0xffffff81ee693b60 : 0xffffff8000739127
0xffffff81ee693c60 : 0xffffff800073950b
0xffffff81ee693cb0 : 0xffffff8000ed17f9
0xffffff81ee693d20 : 0xffffff7f81313970
@cedriclombardot
cedriclombardot / gist:3487915
Created August 27, 2012 12:13
Check cs for files before commits
# See http://cs.sensiolabs.org
# Run this command in your git repo to run cs fixer on the modified files
git st --porcelain | cut -d" " -f2,3 | cut -d" " -f2 | xargs -I {} sh -c 'php php-cs-fixer.phar fix {}'
@cedriclombardot
cedriclombardot / gist:3379438
Created August 17, 2012 14:53
Delete all dead symlinks
find -L -type l -delete
@cedriclombardot
cedriclombardot / gist:3170772
Created July 24, 2012 15:44
Test symfony2 request scope
<?php
/**
* This is a sample to make unit test in symfony using request service
*/
namespace xxxx
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class TestCase extends WebTestCase
@cedriclombardot
cedriclombardot / gist:2761195
Created May 21, 2012 08:36
Copy all remotes git branch for origin and push to origin2
git branch -a | grep remotes/origin | grep -vw 'HEAD' | cut -d'/' -f3 | xargs -I {} sh -c 'git co {} && git push -u origin2 {}'
@cedriclombardot
cedriclombardot / git_rewrite.rb
Created May 18, 2012 11:45
Remove git sensitive datas
#!/usr/bin/ruby
#
# Remove history of files wich contains passwords and commit the last version of the file
# http://help.github.com/remove-sensitive-data/
#
# How to use ?
# 1) Clone your repo
# 2) copy this file at the root of the repo
# 3) update glob_to_rewrite
# 4) run ruby git_rewrite.rb
@cedriclombardot
cedriclombardot / .bash_aliases
Last active August 29, 2015 14:24
My Bash config
alias vh="cd /etc/apache2/sites-available/"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias s="git st"
alias d="git diff"
alias ackk="ack -f | ack"
alias ccc="sudo rm -rf */cache/*"
alias cs="git st | grep modified | cut -d ":" -f2 | xargs -I {} php-cs-fixer fix {} && git st | grep -vw modified | grep src | cut -d "#" -f2 | xargs -I {} php-cs-fixer fix {}"
alias dmagick="git diff -w --word-diff --color-words=."
@cedriclombardot
cedriclombardot / README.md
Last active August 29, 2015 13:57
Shells de sauvegarde

Dump your server

  1. Copy all of those files in /opt/dump
  2. Configure config.cfg
  3. Cron your dump for dumpfiles.sh and dumpsql.sh