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 / php-syntax-error
Created August 21, 2015 09:21
Check syntax error in php project
find . -type f -name "*.php" -exec php -l '{}' \;
@julienbourdeau
julienbourdeau / md5_base64.php
Created October 3, 2015 14:50
PHP: md5_base64 function
function md5_base64( $data ) {
return preg_replace('/=+$/','',base64_encode(pack('H*',md5($data))));
}
@julienbourdeau
julienbourdeau / decode_html.sh
Created October 3, 2015 14:53
Decode HTML entities in text file
#!/bin/bash
for tabfile in `find . -name tab.xml -type f`;
do
tempfile=$tabfile".temp"
touch $tempfile;
while read line
do
php -R 'echo html_entity_decode($argn)."\r\n";' >> $tempfile
done < $tabfile
@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
@julienbourdeau
julienbourdeau / gist:c568badc3e219208ee55
Created October 7, 2015 08:07
Retrieve lost file with git
git log --all -- <path-to-file>
@julienbourdeau
julienbourdeau / gist:e0990ca03f743aea2e7d
Created October 16, 2015 13:57
git filter-branch: move to subdirectory
git filter-branch --tree-filter 'mkdir -p themes/StarterTheme; for f in *; do if ! [ $f = themes ]; then mv $f themes/StarterTheme; fi; done;' HEAD
@julienbourdeau
julienbourdeau / gist:f9693ebdd83215db507c
Created October 26, 2015 08:52
SQL: Select with subquery, union and date_format
SELECT DATE_FORMAT(MAX(connection_date), '%Y-%m-%d')
FROM
(
SELECT MAX(`last_connection_date`) as connection_date FROM `employee`
UNION ALL
SELECT MAX(`date_upd`) as connection_date FROM `log`
) AS subquery'
https://atom.io/packages/sync-settings
@julienbourdeau
julienbourdeau / app.txt
Last active June 5, 2019 14:45
[Inspiration] Documentation and Blog themes I like
https://venturecost.com/
@julienbourdeau
julienbourdeau / keybase.md
Created December 11, 2015 22:31
keybase.md

Keybase proof

I hereby claim:

  • I am julienbourdeau on github.
  • I am julienbourdeau (https://keybase.io/julienbourdeau) on keybase.
  • I have a public key ASC6z4PI3P2up0tsBDeu5cU30g1QAy58iyVNMqQ6RDSqcwo

To claim this, I am signing this object: