Skip to content

Instantly share code, notes, and snippets.

View adelarcubs's full-sized avatar

Adelar Tiemann Junior adelarcubs

  • Asigra
  • Barueri - SP
View GitHub Profile
package appiumworkaround;
import io.appium.java_client.windows.WindowsDriver;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Started by user admin
Building in workspace /var/jenkins_home/workspace/Blog_sample/Mirror_git
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Cloning the remote Git repository
Cloning repository https://github.com/adelarcubs/repo_base
> git init /var/jenkins_home/workspace/Blog_sample/Mirror_git # timeout=10
Fetching upstream changes from https://github.com/adelarcubs/repo_base
> git --version # timeout=10
using GIT_ASKPASS to set credentials adelarcubs github
#Forma de resolver o ssh-agent no docker
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
#Git no jenkins deixa sem branch
git checkout master
#Verifica quais branchs estão criadas no repositório e depois baixa elas localmente
git branch -r | grep -v '\->' | grep -v 'master' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
#Adiciona o repositório clone
git remote add origin-mirror git@github.com:adelarcubs/repo_base_copy.git
<?php
$userEmail = 'test@test.com';
$userPassword = '123456';
// Using Doctrine for example
$user = $repository->findByEmail($userEmail);
if(!$user) {
// User not found
// LOGIN ERROR
<?php
$userEmail = 'test@test.com';
$userPassword = '123456';
// Using Doctrine for example
$user = $repository->findByEmail($userEmail);
if(!$user) {
// User not found
// LOGIN ERROR
<?php
for($cost = 4; $cost <= 18; $cost++){
$start = microtime(true);
password_hash("test", PASSWORD_DEFAULT, ['cost' => $cost]);
$end = microtime(true);
echo 'Cost: ' . $cost . ' Time cost: ' . ($end - $start) . "\n";
}
<?php
$userEmail = 'test@test.com';
$userPassword = '123456';
// Using Doctrine for example
$user = $repository->findByEmail($userEmail);
if(password_verify($userPassword, $user->getPassword())){
$options = ['cost' => 10];
if(password_needs_rehash($user->getPassword(), PASSWORD_DEFAULT, $options)){
<?php
$userEmail = 'test@test.com';
$userPassword = '123456';
// Using Doctrine for example
$user = $repository->findByEmail($userEmail);
if(password_verify($userPassword, $user->getPassword())){
// DO LOGIN
}
<?php
$userPassword = '123456';
$options = ['cost' => 10];
$hash = password_hash($userPassword, PASSWORD_DEFAULT, $options);
// save $hash as password on database
# This is a sample build configuration for PHP.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Dockerhub as your build environment.
image: phpunit/phpunit:5.0.3
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.