Skip to content

Instantly share code, notes, and snippets.

View mcdado's full-sized avatar
🏠
Working from home

David Gasperoni mcdado

🏠
Working from home
View GitHub Profile
@mcdado
mcdado / sphp.sh
Last active October 26, 2016 13:56 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@mcdado
mcdado / Bcrypt.php
Created April 22, 2012 15:37
PHP Bcrypt class
<?php
/*
bcrypt class for PHP 5.3 and above.
An implentation by Marco Arment.
It uses Blowfish hashing.
Simplified by David Gasperoni <mcdado@gmail.com>.
Forked from Marco Arment <me@marco.org>.
This code is released in the public domain.