Skip to content

Instantly share code, notes, and snippets.

View CallumCarmicheal's full-sized avatar

Callum Carmicheal CallumCarmicheal

View GitHub Profile
@CallumCarmicheal
CallumCarmicheal / README.md
Last active January 4, 2025 16:43 — forked from mithicher/tom-select.blade.php
Tom Select Livewire Blade Component (Real time with changing item list)

Attributions

This is a heavily modified version of the original code by mithicher. The previous fork only worked one way so once the component was rendered the options list could not be changed.

Attributes / Parameters

:options - This is an array of the format [ 'id' => 'any', 'title' => 'string', 'subtitle' => 'string' ] for the items in the select dropdown

:selectedItems - A string array of the selected items id's, this can be used in-place of x-model, kept over from the original implementation although I haven't really found a use for it.

id - required if multiple of the same wire:model binding is used

@mithicher
mithicher / tom-select.blade.php
Last active October 25, 2024 19:29
Tom Select Livewire Blade Component
/* Component Usage
// Data for options
$users = \App\User::limit(6)->get()->transform(fn($user) => [
'id' => $user->id,
'title' => $user->name,
'subtitle' => $user->email
]);
// Usage in view
@teameh
teameh / 1-example.com.conf
Last active December 19, 2019 12:57
Silex - Let NGINX handle static files after authentication with PHP
server {
listen 80;
listen [::]:80;
server_name example.com;
root /var/www/project/web;
index index.php;
# catches internal redirects from php with 'X-Accel-Redirect' header
location /private_admin_files {
@CallumCarmicheal
CallumCarmicheal / SyntaxSchema.cs
Last active September 1, 2016 23:33
C# Python like syntax: A new syntax for C#, maybe a interesting project what's your thoughts?
/*
THIS IS THE DESIGN OF THE COMPILER, PLEASE NOTE EVERYTHING IS DUE TO CHANGE!
EVEN THE NAME IS VAILABLE FOR A CHANGE!
@author Callum Carmicheal
@date
02/09/2016 UK - 19:30->00:23 = Started the whole design of the compiler and language
@desc A simple resyntax of C#, making the code a bit more like Python's structure and syntax,
allowing code to be displayed in a cleaner and clearer way!