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
@marcaum54
marcaum54 / withAuth.js
Last active October 9, 2020 18:39
withAuth.js
import React from "react";
import acesso_login_api from "../../services/AcessoLoginApi"
import redirect from "../../helpers/redirect"
export const withAuth = <T extends object>(C: React.ComponentClass<T>) => {
return class AuthComponent extends React.Component<T> {
static async getInitialProps(ctx) {
const hasCurrentUser = localStorage.getItem("current-user");
@marcaum54
marcaum54 / xml
Last active March 31, 2020 16:51
Declaração de Hiposuficiencia
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Declaração de comparecimento" columnCount="2" pageWidth="580" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="262" columnSpacing="24" leftMargin="18" rightMargin="14" topMargin="14" bottomMargin="14" uuid="16ecacc7-002d-4bbc-8908-51b6abb7b2f3">
<property name="ireport.jasperserver.reportUnit" value="/reports/atendimento/atendimento/hipossuficiencia/hipossuficiencia"/>
<property name="ireport.jasperserver.url" value="http://192.168.0.157:8080/jasperserver/services/repository"/>
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"
@marcaum54
marcaum54 / command
Last active November 27, 2015 02:46
sudo sh -c 'echo zend_extension=$(find /usr/lib/php/extensions -name "xdebug.so") >> $(php -qr "echo php_ini_loaded_file();") && apachectl restart'
@marcaum54
marcaum54 / README.md
Created November 26, 2015 00:39 — forked from jonathantneal/README.md
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\ Text.app/Contents/SharedSupport/bin/subl"
@marcaum54
marcaum54 / regex.php
Last active November 11, 2015 19:44
Laravel - Strong Password Regex
[
'password' => ['required', 'min:8', 'regex:^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=!?]).*$']
]
* { margin: 0; padding: 0; outline: none; }
a img { border: 0; }
label { cursor: pointer }
textarea { height: auto; }
@marcaum54
marcaum54 / gist:826e0d22fedd1de267e6
Created July 5, 2015 03:23
Removendo todos os .svn do projeto
find . -name .svn -exec ls {} \;
find . -name .svn -exec rm -rf {} \;
@marcaum54
marcaum54 / gist:afc90cbfa156194cac5a
Last active August 29, 2015 14:23
Exemplo de como tratrar problema de encoding em arquivos .CSV
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
marcaum54 / gist:9288fca85790f8d0ad9f
Created May 14, 2015 19:49
Laravel: Regex Validators
$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}$/' ],
];
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: