Skip to content

Instantly share code, notes, and snippets.

View D1360-64RC14's full-sized avatar
👨‍💻
Learning

Diego Garcia D1360-64RC14

👨‍💻
Learning
View GitHub Profile
@ronau
ronau / nginx-client-certificate-authentication.md
Last active February 8, 2026 14:06
A simple nginx configuration for a demo of client certificate authentication

Client certificate authentication with nginx

Below is a simple nginx configuration file enabling client certificate authentication, i.e. the user/client has to present a certificate in order to get access.

It is the result of a small proof of concept solution for the following task:

  • A certain web server directory should be used as file storage
  • Transport security (i.e. TLS)
@leodutra
leodutra / bitwise-hacks.js
Last active February 9, 2026 03:04
Fast Int Math + Bitwise Hacks For JavaScript
/**
* Bitwise Mathematics Utilities
*
* A collection of fast bitwise operations for integer mathematics.
* These functions prioritize performance over readability and should be used
* when micro-optimizations are critical (game engines, real-time applications).
*
* References:
* - http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html
* - http://jsperf.com/bitwise-vs-math-object
@cagartner
cagartner / validarRenavam.js
Last active June 20, 2025 04:39
Função para validar Renavam, Valida Renavam, Verifica Renavam
/**
* Função para validar sequencia de digitos de Renavam
*
* @link http://blog.victorjabur.com/2010/05/28/renavam_veiculos_java/ Função baseada em uma de java retirada desse link
* @param string|int renavam Sequencia de digitos do renavam
* @return boolean
*/
function verificaRenavam( renavam ) {
var d = renavam.split("");