Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffrey Way JeffreyWay

View GitHub Profile
View homework-solution.php
<?php
// Connect to the MySQL database.
$dsn = "mysql:host=localhost;port=3306;dbname=myapp;user=root;charset=utf8mb4";
// Tip: This should be wrapped in a try-catch. We'll learn how, soon.
$pdo = new PDO($dsn);
$statement = $pdo->prepare("select * from posts where id = 1");
$statement->execute();
@JeffreyWay
JeffreyWay / index.php
Last active Oct 3, 2022
PHP for Beginners, Episode 10 - Separate Logic From the Template https://laracasts.com/series/php-for-beginners-2023-edition/episodes/10
View index.php
<?php
$books = [
[
'name' => 'Do Androids Dream of Electric Sheep',
'author' => 'Philip K. Dick',
'releaseYear' => 1968,
'purchaseUrl' => 'http://example.com'
],
[
@JeffreyWay
JeffreyWay / homework-solution.php
Created Sep 29, 2022
PHP for Beginners, Episode 9 - Lambdas and Flexibility
View homework-solution.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$books = [
View homework-solution.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$movies = [
View homework-solution.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$books = [
@JeffreyWay
JeffreyWay / homework-solution.php
Last active Sep 19, 2022
PHP For Beginners, Episode 6 - Arrays
View homework-solution.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$usernames = [
@JeffreyWay
JeffreyWay / homework-solution.php
Last active Nov 7, 2022
PHP For Beginners, Episode 5 - Conditionals and Booleans
View homework-solution.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?= 'Hello World' ?>
</h1>
View homework-solution.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?php
View homework-solutions.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?php
View AddMemberModal.vue
<script setup>
import Modal from "@/Components/Modal.vue";
import {useTeamStore} from "@/stores/TeamStore";
import { ref } from "vue";
let showModal = ref(false);
let team = useTeamStore();
</script>
<template>