Skip to content

Instantly share code, notes, and snippets.

View fhferreira's full-sized avatar
🏠
Home-Office since 2005

Flávio H. Ferreira fhferreira

🏠
Home-Office since 2005
View GitHub Profile
@fhferreira
fhferreira / addrgen
Created April 27, 2021 15:06 — forked from JBaczuk/addrgen
addrgen
#!/bin/bash
echo
echo "Welcome to the Bitcoin address generator!"
echo "input private key (32 bytes, hex format)"
read priv
echo ""
echo "#####################################"
# priv=0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D # Testing only
@fhferreira
fhferreira / bitcoin.js
Created April 3, 2021 22:44 — forked from sanjukurian/bitcoin.js
create bitcoin wallet, make a transaction on bitcoin network using bitcoinjs-lib and blockcypher
var request = require('request');
const bitcoin = require('bitcoinjs-lib');
var buffer = require('buffer');
const bitcoinNetwork = bitcoin.networks.testnet;
var rootUrl = "https://api.blockcypher.com/v1/btc/test3";
//create wallets
const TestNet = bitcoin.networks.testnet3;
@fhferreira
fhferreira / LearnGoIn5mins.md
Created January 14, 2021 03:53 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
@fhferreira
fhferreira / sigep.php
Created December 21, 2020 14:12 — forked from viebig/sigep.php
Exemplo de requisição para geração de etiquetas do correios
<?php
$usuario = 'sigep';
$senha = 'n5f9t8';
$contrato = '9912208555';
$cartao = '0057018901';
$context = stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
@fhferreira
fhferreira / bench.php
Created October 23, 2020 21:21 — forked from BenMorel/bench.php
(Medium) BulkInserter benchmark
<?php
/**
* Benchmarks BulkInserter at various batch sizes.
*
* Before running this script, make sure to:
*
* - set your PDO parameters in this file
* - run composer install
* - import setup.sql into your database
@fhferreira
fhferreira / settimeout.php
Created October 12, 2020 18:28 — forked from edwjusti/settimeout.php
setTimeout for php
<?php
class TimeoutClass extends Thread {
public function __construct(callable $cb, int $time, $args){
$this->callback = $cb;
$this->args = $args;
$this->time = $time * 1000;
}
public function run(){
usleep($this->time);
@fhferreira
fhferreira / Configurations for Laravel app on Kubernetes - Dockerfile
Created September 3, 2020 04:12 — forked from CodingMonkTech/Configurations for Laravel app on Kubernetes - Dockerfile
Deploying laravel on kubernetes cluster - Ready to use configuration Files
FROM php:7.2-fpm
COPY app /var/www/
EXPOSE 9000
artifacts:
when: on_failure
paths:
- tests/Browser/screenshots
@fhferreira
fhferreira / Install.sh
Created September 1, 2020 19:05 — forked from jeffturcotte/Install.sh
Laravel Mix / Echo Server / Docker / Traefik Examples
# clone repo
git clone https://github.com/imarc/laravel-echo-example
cd laravel-echo-example
# install php dependencies
composer install
composer run-script install-tasks
# install npm dependencies and build
npm install
@fhferreira
fhferreira / watch.php
Created August 28, 2020 20:15 — forked from leocavalcante/watch.php
Watch script for Swoole HTTP server restarts.
<?php declare(strict_types=1);
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\Process\Process;
$process = new Process(['php', 'index.php']);
echo "Starting process\n";
$process->start();