Skip to content

Instantly share code, notes, and snippets.

View esilvajr's full-sized avatar

Edison Silva Jr esilvajr

  • Arquivei
  • Jaboticabal/São Carlos, SP
View GitHub Profile
@esilvajr
esilvajr / QueueFailedChunkCommand.php
Last active December 18, 2023 17:15
Execute Laravel failed_queue from database using chunk and wait.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Artisan;
class QueueFailedChunkCommand extends Command
{
class OrderState():
def processOrder(self, order):
raise NotImplementedError
class PaymentState():
_payment = None;
def verifyPayment(self) -> None:
class DataMiner():
def mine(self, path: str): #templateMethod
file = self.openFile(path)
rawData = self.extractData(file)
data = self.parseData(rawData)
analysis = self.analyzeData(data)
self.sendReport(analysis)
self.closeFile(file)
def openFile(self, path: str) -> str:
@esilvajr
esilvajr / iti_factory_method_sample.py
Last active April 15, 2023 13:10
iti_factory_method_sample.py
class Cliente(): # Product
def gerencie(self):
raise NotImplementedError
class PessoaFisica(Cliente): # ConcreteProduct
def gerencie(self):
print("Gerenciando pessoas fisicas")
class DatabaseConnection:
__dbInstance = None
@classmethod
def getInstance(cls):
if cls.__dbInstance is None:
cls.__dbInstance = cls()
cls.__dbInstance.connect()
return cls.__dbInstance
@esilvajr
esilvajr / github-net-config.md
Created March 16, 2020 14:27 — forked from guilhermebruzzi/github-net-config.md
NET não libera a porta 22 e impede de acessar o github por ssh

Usar ssh do github com wifi do netcombo

A NET parece que só libera o uso de qualquer porta, como a porta 22 de ssh, para pessoa jurídica em seus novos planos (desde 2016).

Para conseguir usar o github por ssh com plano de internet da NET para pessoa física, é necessário:

Criar o arquivo ~/.ssh/config e adicionar:

Host github.com
@esilvajr
esilvajr / install.sh
Created September 10, 2018 22:33 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@esilvajr
esilvajr / kmskeys10.txt
Created November 6, 2017 17:38 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
@esilvajr
esilvajr / image_phpstorm_server.png
Last active March 27, 2022 23:49
How to use XDebug inside a docker container.
image_phpstorm_server.png
@esilvajr
esilvajr / mysql-docker.sh
Created September 11, 2017 13:02 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE