Skip to content

Instantly share code, notes, and snippets.

View CamKem's full-sized avatar
🔥
Building....

Cam Kemshal-Bell CamKem

🔥
Building....
View GitHub Profile
@CamKem
CamKem / TennisMatch.php
Last active March 25, 2023 10:39
Class: Tennis Match Kata
<?php
namespace Tests\Feature\Katas;
use PhpParser\Node\Expr\Cast\Object_;
class TennisMatch
{
protected Player $playerOne;
@CamKem
CamKem / TennisMatchTest.php
Last active March 25, 2023 10:39
Test: Tennis Match Kata
<?php
namespace Tests\Feature\Katas;
use Tests\Feature\Katas\TennisMatch;
use PHPUnit\Framework\TestCase;
class TennisMatchTest extends TestCase
{
@CamKem
CamKem / Player.php
Created March 25, 2023 10:40
Player Class for Tennis Match Kata
<?php
namespace Tests\Feature\Katas;
class Player
{
public int $points = 0;
public string $name;
@CamKem
CamKem / Register.vue
Last active April 10, 2023 13:00
Breeze / Jetstream Registration with live username check.
<script setup>
import {Link, useForm} from '@inertiajs/vue3';
import InputError from '@/Components/InputError.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue';
import AppHead from "@/Layouts/AppHead.vue";
import {reactive, ref, toRefs} from "vue";
import axios from "axios";
import debounce from "lodash/debounce";
//This is just the gist where I store all the images I use for markup.
@CamKem
CamKem / Filters.php
Last active July 28, 2023 15:34
Abstract Filters Class
<?php
namespace App\Filters;
abstract class Filters
{
/**
* The protected request and query objects.
* @var object
@CamKem
CamKem / EnumMethods.php
Created September 1, 2023 09:34
Group of enum helper methods trait
<?php
namespace App\Traits;
use Exception;
trait EnumMethods
{
/**
@CamKem
CamKem / LayoutStore.js
Last active October 26, 2023 23:29
Layout store (Pinia)
import { defineStore } from "pinia";
import useBreaks from "../Composables/useBreakpoints";
const { isSmall, isMedium, isLarge, isExtraLarge, is2xl, greaterThanMedium, greaterThanLarge } = useBreaks();
export const useLayoutStore = defineStore("layout", {
state: () => ({
sidebar: {
open: false,
expanded: false,
@CamKem
CamKem / DashboardLayout.vue
Created December 14, 2023 08:45
Example of Responsive Layout Using HTML & CSS (Plus JavaScript)
<template>
<SidebarLayout v-if="$page.props.auth.user"
@newPost="handleNewPost"/>
<div id="wrapper"
class="flex w-full place-content-center">
<main id="main"
:class="[
layout.isMedium ? 'max-w-[980px]' : '',
layout.isLarge && !layout.isSidebarExpanded ? 'max-w-[956px]' : '',
layout.isLarge && layout.isSidebarExpanded ? 'max-w-[762px]' : '',
@CamKem
CamKem / vite.config.js
Last active January 2, 2024 05:09
Herd SSL/TLS Vite Config Hack
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
import fs from 'fs';
import { homedir } from 'os';
import { resolve } from 'path';
export default defineConfig({
plugins: [
laravel({