- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
- Ultimate Code Generator - https://webcode.tools/
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
-- select all data | |
SELECT * FROM users; | |
-- select first two users | |
SELECT * FROM users LIMIT 2; | |
-- select specific columns | |
SELECT first_name from users; | |
-- alias columns |
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
-- insert single entry into table | |
INSERT INTO users (first_name, last_name, email) | |
VALUES ('John', 'Smith', '[email protected]'); | |
-- insert multiple entries | |
INSERT INTO users (first_name, last_name, email) | |
VALUES ('John', 'Smith', '[email protected]'), | |
('John', 'Doe', '[email protected]'); | |
-- update |
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
-- create db called users | |
CREATE DATABASE my_app; | |
-- delete db | |
DROP DATABASE my_app; | |
-- use db | |
USE my_app; | |
-- create table |
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 | |
// Connect to DB | |
class Dbh { | |
private $host = ""; | |
private $user = ""; | |
private $pwd = ""; | |
private $dbName = ""; | |
protected function connect(){ |
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 | |
declare(strict_types = 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
<?php | |
spl_autoload_register('autoLoader'); | |
function autoLoader($className) { | |
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
if (strpos($url, 'inc')) { | |
$path = '../classes/'; | |
} else { | |
$path = 'classes/'; | |
} |
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 | |
$password = "test123"; | |
// Password hashing | |
$hash = password_hash($password, PASSWORD_DEFAULT); | |
// Password de-hashing - returns boolean | |
$dehash = password_verify($password, $hash); |
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 | |
// Define a class | |
class User { | |
// Properties | |
public $name; | |
// Constructor - runs when an object is instantiated | |
public function __construct($name) { | |
echo 'Class ' . __CLASS__ . ' instantiated<br>'; |
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
j - move down | |
d - move half page down | |
k - move up | |
u - move half page up | |
F - show shortcuts to click on links | |
link shortcut (lowercase) - open link in background tab | |
H - go back in history | |
L - go forward in history | |
J - go one tab left | |
K - go one tab right |