Skip to content

Instantly share code, notes, and snippets.

View codemonkey76's full-sized avatar

Shane Poppleton codemonkey76

View GitHub Profile
class ModelBrowseService
{
/**
* @param class-string<Model&Searchable> $modelClass
*/
public function browse(
Request $request,
string $modelClass,
?Collection $hits = null,
array $filters = []
@codemonkey76
codemonkey76 / privacy.md
Created March 25, 2025 23:37
Privacy Policy for Phone Us

Phone Us Privacy Policy

Effective Date: 26/03/2025

Last Updated: 26/03/2025

URL: https://phoneus.com.au/privacy-policy

This Privacy Policy describes how Phone Us collects, uses, and protects your personal information when you use our services.

@codemonkey76
codemonkey76 / terms.md
Created March 25, 2025 23:36
Terms of Service for Phone Us

Phone Us Terms of Service

Effective Date: 26/03/2025

Last Updated: 26/03/2025

URL: https://phoneus.com.au/terms-of-service

Welcome to Phone Us. By registering and using our service, you agree to the following Terms of Service. If you do not agree, please do not proceed with registration.

<script setup lang="ts">
import {ref, watch} from "vue";
const props = defineProps<{
modelValue?: boolean | undefined
}>();
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean|undefined): void
@codemonkey76
codemonkey76 / InboundMailController.php
Created February 10, 2024 02:50
Inbound mail controller
<?php declare(strict_types=1);
namespace App\Http\Controllers;
use Mail;
use Exception;
use Spatie\Regex\Regex;
use App\Models\Customer;
use App\Mail\NewVoicemail;
use App\Models\Voicemailbox;
@codemonkey76
codemonkey76 / main.rs
Created December 12, 2023 05:04
Advent Of Code - 2023 - Day 5 - Optimized Solution in Rust
use std::fs;
use std::collections::HashMap;
use std::time::Instant;
use itertools::Itertools;
fn apply_mapping(current: u32, map: &Mapping) -> u32 {
let mut value: u32 = current;
for entity in &map.mappings {
if value >= entity.src && value < entity.src + entity.range {
import os
import re
import random
import subprocess
def run_command(cmd):
result = subprocess.run(cmd, stdout=subprocess.PIPE, shell=True)
return result.stdout.decode('utf-8').strip()
def get_current_bg(output):
@codemonkey76
codemonkey76 / tmux.conf
Created June 7, 2023 01:00
TMUX Configuration
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
set -g history-limit 10000
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
unbind C-b
@codemonkey76
codemonkey76 / Accordion.php
Last active March 16, 2023 03:19
Using wire:model on nested component
<?php
namespace App\Http\Livewire\Controls;
use Livewire\Component;
class Accordion extends Component
{
protected $listeners = ['refreshAccordion' => '$refresh'];
<div x-cloak x-data="{
hourOptions: [...Array(12+1).keys()].slice(1),
minuteOptions: [...Array(60).keys()],
isHourHighlighted: function(option) { return this.hourHighlighted === option },
isHourSelected: function(option) { return this.hourValue === option },
isMinuteHighlighted: function(option) { return this.minuteHighlighted === option },
isMinuteSelected: function(option) { return this.minuteValue === option },
highlightHourOption: function(option) { this.hourHighlighted = option },
unHighlightHourOption: function(option) { this.hourHighlighted = null },
highlightMinuteOption: function(option) { this.minuteHighlighted = option },