Skip to content

Instantly share code, notes, and snippets.

@morrizon
morrizon / double_encoding_issue.md
Last active January 12, 2017 16:11
Double encoding issue

Some times I found in some legacy code a doubled encoding issue (latin1 tables with UTF-8).

I workaround to fix the issue I find the problematic content:

db=$1
user=$2
pass=$3

mysqldump -u$user -p$pass $db > bkpEncodingIssue$db.sql
mysqldump --default-character-set=latin1 -u$user -p$pass $db | sed 's/DEFAULT CHARSET=LATIN1/DEFAULT CHARSET=utf8/i' | grep -v "^/\*" > bkpEncodingIssue${db}NewEncoding.sql
@morrizon
morrizon / aliases.md
Created December 3, 2016 12:00
Useful alias

bash

alias ssh-agent='ssh-agent bash -c "ssh-add;bash"'
@morrizon
morrizon / gitconfig.md
Last active January 25, 2017 16:29
Default git config

Template of .gitconfig with some aliases

[user]
    name = John Doe
    email = nomail@example.com
  
[color]
    diff = auto
    status = auto
@morrizon
morrizon / php_tools_for_DDD.md
Last active December 4, 2016 13:40
PHP tools for DDD