Skip to content

Instantly share code, notes, and snippets.

View Braunson's full-sized avatar

Braunson Yager Braunson

View GitHub Profile
{{--
Icon view component for Laravel 7.
@disclaimer The icons used in this component are taken from "Refactoring UI Heroicons" (md-outline collection).
For more info https://github.com/refactoringui/heroicons by Steve Schoger & Adam Wathan.
@copyright MIT
@author Maurizio <https://twitter.com/mauriziolepora>
@mattstauffer
mattstauffer / example.html
Created March 3, 2020 15:46
Example of logging Laravel Livewiure component state
<script src="{{ asset('js/app.js') }}"></script>
<script>
let logComponentsData = function () {
window.livewire.components.components().forEach(component => {
console.log(component.name);
console.log(component.data);
});
};
document.addEventListener("livewire:load", function(event) {
@calebporzio
calebporzio / RouteDirectives.php
Created January 4, 2020 10:33
Blade Route Directives
<?php
// Register these inside a service provider:
Blade::directive('route', function ($expression) {
return "<?php echo route({$expression}) ?>";
});
Blade::directive('routeIs', function ($expression) {
return "<?php if (request()->routeIs({$expression})) : ?>";
@IanColdwater
IanColdwater / twittermute.txt
Last active April 14, 2025 16:31
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@ManojKiranA
ManojKiranA / full.php
Last active December 21, 2021 01:39
Inertia Js Paginate
Route::get('/', function (\Illuminate\Http\Request $request) {
$initialSearch = $request->query('search', '');
$userQuery = User::query()
->when($request->filled('search'),function($query) use ($initialSearch){
$query->where('name','LIKE','%'.$initialSearch.'%')
->orWhere('email','LIKE','%'.$initialSearch.'%');
});
/* dragging logic for nomadlist.com/dating */
/* by @levelsio */
/* MIT license */
/* <dragging logic> */
$('body').on('mousedown touchstart','.card',function(e) {
if(!currentCardUserId) return;
if($('card.match_card').is(':visible')) return;
if(typeof e.originalEvent.touches !=='undefined') {
/* touch device */
@stefanzweifel
stefanzweifel / format_php.yml
Last active September 29, 2021 08:29
GitHub Actions Workflows to run prettier and php-cs-fixer automatically
name: Format PHP
on:
pull_request:
paths:
- '*.php'
jobs:
php-cs-fixer:
runs-on: ubuntu-latest

Learning Plan for Design Patterns and Principles of Good Design

These learning resources primarily focus on programming using Good Design Principles and Design Patterns

  • There is an emphasis on learning using PHP, although most patterns are universal to every object orientated language.
@stevebauman
stevebauman / DirectoryMounter.php
Last active June 18, 2020 17:29
PHP Windows Directory Mounter
<?php
use UnexpectedValueException;
class DirectoryMounter
{
/**
* The path to mount.
*
* @var string|null
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active March 29, 2025 12:18
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',