This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
var md5 = require('md5'); | |
/** | |
* @file | |
* Secure password hashing functions for user authentication. | |
* | |
* Based on the Portable PHP password hashing framework. | |
* @see http://www.openwall.com/phpass/ | |
* | |
* An alternative or custom version of this password hashing API may be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PDO Connection to MySQL | |
$conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password'); | |
// PDO Connection to PostgreSQL | |
$conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password'); | |
// A quick Select Query with For Loop | |
foreach ($conn->query("SELECT * FROM profile") as $row) | |
echo $row['fullname']; |