Skip to content

Instantly share code, notes, and snippets.

View brunoviana's full-sized avatar
😎

Bruno Viana brunoviana

😎
View GitHub Profile
@kelvysmoura
kelvysmoura / hashcash_pow.js
Last active May 26, 2022 00:00
Hashcash / Proof of Work (POW)
/**
* Esse é um estudo sobre Hashcash que acabou se tornando Proof of Work (POW)
*
* As semelhança que eu identifiquei:
* - Ambos usam da capacidade computacional para resolver um desafio, que é encontrar um quantidade de zeros "0"
* em uma hash SHA-256.
*
* As diferenças que eu identifiquei:
* - Hashcash foi inicial feito para enviar spam de email. É um desafio enviado para pelo servidor, parecido com
* versão:timestamp_de_validade:nonce:SHA-256:SOLUÇÃO. A solução é o que o cliente (navegador) precisa descobrir.
@adrienjoly
adrienjoly / fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Last active April 28, 2025 08:29
Fix `dyld[]: missing symbol called` errors when running Node.js programs on M1 Macs (apple silicon)

Problem

If you're getting this kind of error when running Node.js programs with binary dependencies that don't support M1 yet, e.g.:

$ yarn test
dyld[51175]: missing symbol called
dyld[51176]: missing symbol called
@brunoviana
brunoviana / rfc.md
Created May 28, 2021 11:20 — forked from eminetto/rfc.md
Template de RFC

Título

Descrição do problema

Devemos explicar o problema claramente e identificar detalhes adicionais que a equipe precise saber. Devemos aqui descrever o contexto, o que foi feito até agora e o estado atual.

A descrição também serve como uma trilha à qual podemos voltar no futuro para entender o raciocínio que tínhamos na época e ver quais restrições e requisitos mudaram.

Possíveis abordagens

@kimtrien
kimtrien / webhook.php
Created February 24, 2020 14:52
Satis webhook
<?php
// Initiate Symfony
require_once __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Process\Process;
// Basic-Configuration
$config = [
'bin' => 'bin/satis',
'json' => 'satis.json',
@erikhansen
erikhansen / README.md
Last active February 28, 2023 13:59
Patch Magento 2 extension that must be installed in app/code

See also this alternative approach: https://gist.github.com/cmtickle/8900629447429126ffd7ff84e56ec780#to-patch-code-in-appcode

If you need to patch an M2 extension that isn't available to be installed via Composer, and you're concerned about losing edits directly to files in app/code/<Vendor> directory, you can install and then patch the extension locally using these steps:

  1. Copy the extension into an arbitrary folder location like app/code/packages/VendorName/ModuleName (this assumes this module has a composer.json file with the package name of vendorname/module-modulename)

  2. Run this command to add your custom package location to the composer repositories list:

    composer config repositories.vendorname/module-modulename path app/packages/VendorName/ModuleName
    
  3. Require the extension:

@raftheunis87
raftheunis87 / hyperjs.md
Last active April 21, 2025 08:26
Hyper.js + Hyper.js Plugins + ZSH + Starship + Fira Code + Dark Theme - (macOS)

Hyper.js

@rohankhudedev
rohankhudedev / opcache.ini
Last active March 14, 2025 06:20
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512
@igortik
igortik / nginx.conf
Last active April 3, 2025 18:55
Nginx optimized configuration with DDoS mitigation
user nginx;
# one(1) worker or equal the number of _real_ cpu cores. 4=4 core cpu
worker_processes 4;
# renice workers to reduce priority compared to system processes for
# machine health. worst case nginx will get ~25% system resources at nice=15
worker_priority -5;
@Antnee
Antnee / generator_return_types.php
Last active September 3, 2023 23:40
PHP 7 Generator Return Type
<?php
class Item {
private $id;
public function __construct(int $id)
{
$this->id = $id;
}
public function id() : int
{
@gwillem
gwillem / magento-nginx.conf
Last active July 29, 2023 10:13
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {