Skip to content

Instantly share code, notes, and snippets.

View pedropuppim's full-sized avatar
🎯
Focusing

Pedro Puppim pedropuppim

🎯
Focusing
View GitHub Profile
@pedropuppim
pedropuppim / selenium-php-webdriver-cheatsheet.md
Created July 31, 2017 02:53 — forked from aczietlow/selenium-php-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);

@pedropuppim
pedropuppim / first_data.php
Created December 16, 2016 12:37
First Data Php
<?php
class FirstData
{
protected $host = "api.demo.globalgatewaye4.firstdata.com";
protected $protocol = "https://";
protected $uri = "/transaction/v12";
/*Modify this acording to your firstdata api stuff*/
protected $hmackey = "XXXXXXXXXXXXXXXXXXXXXXX";
@pedropuppim
pedropuppim / add.sh
Last active October 9, 2017 17:06
add.sh
#!/bin/bash
clear
echo ''
echo -e Criando dominio: $1
echo ''
SITE=$1
DOM=${SITE%.*}
EXT=${SITE#*.}
DB=auto_$DOM$EXT
@pedropuppim
pedropuppim / count_linhas_txt.php
Last active October 9, 2017 17:18
Contando numero de linhas de um arquivo txt em php
<?php
$file = new SplFileObject('cpf45.txt');
$file->seek(PHP_INT_MAX);
echo $file->key() + 1;
die;
@pedropuppim
pedropuppim / login_cakephp3.php
Created May 31, 2018 12:50
login_cakephp3.php
<?php
public function login()
{
$this->layout = 'login_page';
if ($this->request->is('post')) {
$user = $this->Auth->identify();
if ($user){
@pedropuppim
pedropuppim / Wordpress Vulnerability Scanners
Created March 2, 2019 02:31
Wordpress Vulnerability Scanners
https://lnkd.in/dnMkM5H
https://lnkd.in/dAzZ2Ck
https://lnkd.in/db9-Hdq
https://lnkd.in/d8fD2CJ
https://lnkd.in/d293dcN
https://lnkd.in/dsyqsV9
https://lnkd.in/da4t3PP

Pegar Ip do conteiner:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nomeContainer

Criar Rede:
docker network create nomeDaRede

Build imagem:
docker build -t nomeDaImagem .

Rodar container:

@pedropuppim
pedropuppim / renomear_arquivos.php
Last active July 31, 2019 01:53
renomeia recursivamente arquivos removendo caracteres especiais
<?php
function tratarNome($string){
$string = iconv( "UTF-8" , "ASCII//TRANSLIT//IGNORE" , $string );
$string = preg_replace( array( '/[ ]/' , '/[^A-Za-z0-9.\-]/' ) , array( '' , '' ) , $string );
return $string;
}
@pedropuppim
pedropuppim / bin-cc.md
Last active November 28, 2019 18:36 — forked from erikhenrique/bin-cc.md

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
@pedropuppim
pedropuppim / Dockerfile.sh
Last active January 31, 2020 01:32
Dockerfile.sh
FROM ubuntu:bionic
LABEL maintainer="ppuppim@gmail.com"
LABEL description="Apache 2.4 / PHP 7.2"
RUN apt-get update
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y tzdata