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 / gist:6716659
Created September 26, 2013 16:30
Esse foi o resultado me retornado passando os seguintes parametros: $Tipo = 'P' $SiteId = 35
Array
(
[0] => stdClass Object
(
[Tipo] => P
[Id] => 1535
[Nome] => Exame de Ordem - Administrativo Completo
[Valor] => 389,00
[Objetivo] => <p>&lt;p&gt;a&lt;/p&gt;</p>
[Temas] => <p>&lt;p&gt;a&lt;/p&gt;</p>
<?php
//72F82C4B0CBCC1704CDD2130E685E767
class Dota2_API
{
protected $_apiKey;
const HEROES_NAME_PREFIX = 'npc_dota_hero_';
const URL_GETHEROES = 'https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/';
@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);