Skip to content

Instantly share code, notes, and snippets.

View marcaum54's full-sized avatar

Marcos Fábio dos Santos Amaral Júnior marcaum54

View GitHub Profile
@dmitriynet
dmitriynet / php
Created November 20, 2015 10:05
mb_unserialize
function mb_unserialize($string)
{
$recovered = preg_replace_callback(
'!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s',
function($match) {
return 's:' . mb_strlen($match[2], '8bit');
},
$string
);
@vratiu
vratiu / .bash_aliases
Last active April 22, 2024 01:54
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset