Skip to content

Instantly share code, notes, and snippets.

View navossoc's full-sized avatar
🍕
It's always a good time for pizza

Rafael Cossovan navossoc

🍕
It's always a good time for pizza
View GitHub Profile
@raffis
raffis / php
Created October 8, 2019 07:50
pure md5 algorithm written in php with serialization support
<?php
namespace Hash;
/**
* PHP implementation of the MD5 algorithm according RFC-1321.
* This implementation has support for hash context serialization which the php inbuilt HashContext has not.
*/
class MD5
{
/**
@vibegui
vibegui / nodejs-ubuntu-bind-port-80.md
Last active September 19, 2024 01:07
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@Plutor
Plutor / fnBase36.sql
Created April 27, 2012 17:33
BIGINT to base 36 conversion in T-SQL
ALTER FUNCTION dbo.fnBase36
(
@Val BIGINT
)
RETURNS VARCHAR(9)
AS
BEGIN
DECLARE @Result VARCHAR(9) = ''
IF (@Val <= 0)