- Add new table to the main db users table, with needed columns (id, email, password, first_name, last_name, restore_key, created_at, updated_at)
- Add a migration for the columns mentioned above
- Tests the migration on local and also record the time it takes to run locally.
- Add form to create new user and make persist it in the db table. Password will be encrypted using SHA512.
- Do basic validation like required
- Enhance validation to accept only email in email field, accept only alphabets (not numbers) for first name and last name.
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
~/Projects/vagrant ᐅ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Checking if box 'puphpet/ubuntu1404-x64' is up to date... | |
==> default: Clearing any previously set forwarded ports... | |
==> default: Clearing any previously set network interfaces... | |
==> default: Preparing network interfaces based on configuration... | |
default: Adapter 1: nat | |
default: Adapter 2: hostonly | |
==> default: Forwarding ports... | |
default: 22 => 9137 (adapter 1) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?php | |
print "hello world"; | |
?> |
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
@checkout | |
Feature: Checkout with offline payment | |
In order to pay with cash or by external means | |
As a Customer | |
I want to be able to complete checkout process without paying | |
Background: | |
Given the store operates on a single channel in "France" | |
And the store has a product "PHP T-Shirt" priced at "$19.99" | |
And the store ships everywhere for free |
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
<?php | |
namespace DataProvider\Example\Test; | |
use DataProvider\Example\Checkout; | |
use PHPUnit_Framework_TestCase; | |
/** | |
* Checkout test for Cash and Credit card. | |
*/ |
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
var codes = generateUniqueCodes(10000000); | |
var query = printQuery(codes); | |
console.log(query); | |
function unique(arr) { | |
var sorted = arr; | |
sorted.sort(); | |
return sorted.filter(function(value, index, arr){ | |
if(index < 1) | |
return true; |
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
urls = $$('a.listing-result__address'); | |
links = []; | |
ids = []; | |
for (url in urls) { | |
links.push(urls[url].href.split('-')); | |
} | |
for(linkArr of links) { | |
ids.push(linkArr[linkArr.length - 1]); | |
} | |
console.log(ids.join()); |
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
async function get(params) { | |
const today = new Date().toISOString().split('T')[0]; | |
const {fromCurrency='AUD', toCurrency='USD', onDate=today} = params; | |
let exchangeRates = await db.query( | |
`SELECT rate, created_at FROM exchange_rates WHERE from_currency = ? AND to_currency = ? AND on_date = ?`, | |
[fromCurrency, toCurrency, onDate] | |
); | |
if (exchangeRates.length) { |
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
#!/bin/bash | |
if [ -z "${SAUCE_USERNAME}" ] || [ -z "${SAUCE_ACCESS_KEY}" ]; then | |
echo "This script can't run without your Sauce credentials" | |
echo "Please set SAUCE_USERNAME and SAUCE_ACCESS_KEY env variables" | |
echo "export SAUCE_USERNAME=ur-username" | |
echo "export SAUCE_ACCESS_KEY=ur-access-key" | |
exit 1 | |
fi | |
SAUCE_TMP_DIR="$(mktemp -d -t sc.XXXX)" |
OlderNewer