https://www.udemy.com/mysql-and-sql-from-beginner-to-advanced
delimiter
will change what is used to terminate statements
delimiter $$
select * from books$$
// nand (not and): if both values are 1 return 0, otherwise return 1 | |
const nand = (a, b) => (a === 1 && b === 1 ? 0 : 1) | |
// using only the nand function (or multiple nand functions), write a new composite "and" function | |
// "and" function returns 1 if both are both 1 return 1, otherwise return 0 | |
const and = (a, b) => { | |
// write your function here | |
} |
const names = ['George', 'Ringo', 'John', 'Paul'] | |
const getEmailAddress = (name) => new Promise(resolve => setTimeout(resolve(name + '@beetle-mail.com'), 100)); | |
// write a function that prints out all the names with email addresses as an array using the getEmailAddress function | |
// output should be: ['[email protected]', '[email protected]', '[email protected]', '[email protected]'] |
const people = { | |
adrian: { | |
age: 21, | |
department: 'design' | |
}, | |
emma: { | |
age: 15, | |
department: 'development' | |
}, | |
rachael: { |
const nand = (a, b) => (a === 1 && b === 1 ? 0 : 1) | |
// NAND - A and B are both 1 return 0 | |
// const A = 1 | |
// const B = 0 | |
// console.log(nand(A, B)) | |
// NOT - return not A (OR B) | |
// const A = 1 | |
const not = (x) => nand(x, x) | |
// console.log(not(A)) |
https://devanswers.co/cant-connect-mysql-server-remotely/ - allow access to mysql (Digital Ocean WP) |
type City { | |
id: ID!, | |
name: String!, | |
country: String!, | |
} | |
type Query { | |
fetchCity(id: ID!): City | |
} |
https://www.udemy.com/mysql-and-sql-from-beginner-to-advanced
delimiter
will change what is used to terminate statements
delimiter $$
select * from books$$
<?php | |
class Person { | |
protected $name, $email, $id; | |
public function setName($name) { | |
$this->name = $name; | |
} | |
public function getName() { |
<?php | |
use PHPUnit\Framework\TestCase; | |
require('./Person.php'); | |
class PersonTest extends TestCase { | |
public function testPersonClassConstructorIsCalledAsExpected() { | |
$mock = $this->getMockBuilder('Person')->disableOriginalConstructor()->getMock(); | |
$mock->expects($this->once())->method('setName')->with($this->equalTo('richard')); |
<?php | |
class Person { | |
protected $name, $email, $id; | |
public function setName($name) { | |
$this->name = $name; | |
} | |
public function getName() { | |
return $this->name; |