Skip to content

Instantly share code, notes, and snippets.

Marcos Fábio dos Santos Amaral Júnior marcaum54

Block or report user

Report or block marcaum54

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View command
sudo sh -c 'echo zend_extension=$(find /usr/lib/php/extensions -name "") >> $(php -qr "echo php_ini_loaded_file();") && apachectl restart'
marcaum54 /
Created Nov 26, 2015 — forked from jonathantneal/
Local SSL websites on Mac OSX

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\"
marcaum54 / regex.php
Last active Nov 11, 2015
Laravel - Strong Password Regex
View regex.php
'password' => ['required', 'min:8', 'regex:^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=!?]).*$']
View RESET.css
* { margin: 0; padding: 0; outline: none; }
a img { border: 0; }
label { cursor: pointer }
textarea { height: auto; }
marcaum54 / gist:826e0d22fedd1de267e6
Created Jul 5, 2015
Removendo todos os .svn do projeto
View gist:826e0d22fedd1de267e6
find . -name .svn -exec ls {} \;
find . -name .svn -exec rm -rf {} \;
marcaum54 / gist:afc90cbfa156194cac5a
Last active Aug 29, 2015
Exemplo de como tratrar problema de encoding em arquivos .CSV
View gist:afc90cbfa156194cac5a
function csv($items)
$fileName = date('Y-m-d_H-i-s') . '.csv';
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename={$fileName}");
//BUGFIX - Adiciona o BOM
echo chr(255) . chr(254);
marcaum54 / gist:9288fca85790f8d0ad9f
Created May 14, 2015
Laravel: Regex Validators
View gist:9288fca85790f8d0ad9f
$examples = [
'cpf' => [ 'regex:/^\d{3}.\d{3}.\d{3}-\d{2}$/' ],
'cnpj' => [ 'regex:/^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/' ],
'telefone' => [ 'regex:/^\(\d{2}\) \d{4}-\d{4,5}$/' ],
'cep' => [ 'regex:/^\d{5}-\d{3}$/' ],
View uninstall-laravel-workbench-package
Since I was looking all around how to uninstall packages and after reading tones
of documentations here's the short how-to uninstall a workbench package in Laravel
(or how I managed it to work out):
1. Remove package service provider from 'providers' array in app/config/app.php
2. Remove the package folder in workbench/
3. Run:
View gist:c1b5ed3525e7ab1edb30
highlight: function(element, errorClass) {
$(element).fadeOut(function() {
rules: {
name: {
required: true,
minlength: 2
View gist:b8c55230fc2f395dd6ef
protected function get400() {
$content = $this->getHttpObject()->getContent();
$erros = json_decode($content, true);
$erro = array();
if (is_array($erros)) {
if (key_exists("Erros", $erros) && is_array($erros["Erros"])){
foreach ($erros["Erros"] as $key => $value) {
You can’t perform that action at this time.