Skip to content

Instantly share code, notes, and snippets.

Conquering the world one line of code at a time

Steve McDougall JustSteveKing

Conquering the world one line of code at a time
View GitHub Profile
JustSteveKing / pint.json
Created January 6, 2023 14:23
Laravel Pint configuration
View pint.json
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
JustSteveKing / tailwind_light.yaml
Created September 5, 2022 19:18
TailwindCSS Light Warp Theme
View tailwind_light.yaml
accent: "#818cf8"
foreground: "#0f172a"
background: "#f8fafc"
details: "lighter"
red: "#f87171"
yellow: "#facc15"
black: "#0f172a"
cyan: "#22d3ee"
JustSteveKing / Mock
Created February 1, 2022 09:22
A Mock Tech test
View Mock


We need a new website built that will show a list of products and categories available from our online store. Our online store is currently available through a third party system API

Our products and categories go through weekly releases, so we need a task in place that will sync our records on a weekly basis.

There is no stock control system needed.

JustSteveKing / Laravel Repository.php
Created August 7, 2021 06:57
An example on Laravel Eloquent Repository
View Laravel Repository.php
abstract class Repository
protected Builder $query;
public function all(): null|Collection
return $this->query->get();
JustSteveKing / Notification.php
Last active September 5, 2022 08:21
Simple Livewire and Tailwind notifications
View Notification.php
namespace App\Http\Livewire;
use Livewire\Component;
class Notification extends Component
public $loaded = false;
JustSteveKing / Colored.vue
Last active April 26, 2018 13:35
Component Structure for Buttons
View Colored.vue
<button class="btn" :classList="classList">
<template v-if="this.icons">
{{ this.text }}
JustSteveKing / localStorage.async.js
Created March 2, 2017 15:18
Using JavaScript Promises to stop render blocking with localStorage
View localStorage.async.js
class Storage {
get(item) {
const request = new Promise((resolve, reject) => {
let data = localStorage.getItem(item);
console.log(`Start of promise`);
(data) ? resolve(data) : reject();
request.then((data) => {
console.log(`promise resolved`);
JustSteveKing / localStorage.size.js
Created March 2, 2017 15:11
A little script to check the size of your localStorage - for management purposes
View localStorage.size.js
let total = 0, amount, item;
for (item in localStorage) {
amount = ((localStorage[item].length + item.length) * 2);
total += amount;
console.log(`Total = ${(total / 1024).toFixed(2)}KB`);
JustSteveKing / event.js
Created March 2, 2017 15:09
Custom Event Handler
View event.js
class Event {
constructor() { = {};
fire(event, data) {
const Event =[event];
if( Event ) {
Event.forEach(callback => {, data);
JustSteveKing / AccountController.php
Last active January 7, 2016 16:22
Using polymorphism in Laravel Auth
View AccountController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Identity;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class AccountController extends Controller {