This file contains hidden or 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 hidden or 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
| expect 100-continue | |
| content-length 1998 | |
| connection close | |
| x-wc-webhook-delivery-id 36e520ebabc2fa725092ff4a47acedf2 | |
| x-wc-webhook-id 3 | |
| x-wc-webhook-signature 5poyFy4qB6fdvvT5pGbefZmfkpL48uD47F0WYwfmpo4= | |
| x-wc-webhook-event created | |
| x-wc-webhook-resource order | |
| x-wc-webhook-topic order.created | |
| x-wc-webhook-source https://www.website.com/ |
This file contains hidden or 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 hidden or 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']; |