Skip to content

Instantly share code, notes, and snippets.

View habibtalib's full-sized avatar

Habib Talib habibtalib

View GitHub Profile
@eighty9nine
eighty9nine / MyFirstReport.php
Created December 31, 2023 10:41
A sample quick start report
<?php
namespace App\Filament\Reports;
use App\Models\User;
use EightyNine\Reports\Components\Image;
use EightyNine\Reports\Components\Text;
use EightyNine\Reports\Components\VerticalSpace;
use EightyNine\Reports\Report;
use EightyNine\Reports\Components\Body;
# Source: https://gist.github.com/2dad051fe41bd2bbcf94eda74386ce49
#############################################
# KEDA: Kubernetes Event-Driven Autoscaling #
# https://youtu.be/3lcaawKAv6s #
#############################################
# Additional Info:
# - KEDA: https://keda.sh
# - Robusta: https://robusta.dev
@bradtraversy
bradtraversy / laravel_valet_setup.md
Last active June 12, 2024 11:45
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@monoman81
monoman81 / CreateMediaRecord.php
Created April 16, 2021 18:40
Filament Relation Managers and Spatie Media Library
<?php
namespace App\Filament\Resources\Admin\ProductResource\RelationManagers;
use Filament\Resources\RelationManager\CreateRecord;
class CreateMediaRecord extends CreateRecord
{
public function getMediaRealPath()
@monoman81
monoman81 / Brand.php
Last active February 8, 2024 06:49
Using Filament with Spatie Media Library
//Model Brand.php.
<?php
namespace App\Models\Admin;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Spatie\MediaLibrary\HasMedia;
@tanthammar
tanthammar / session-timeout-alert-after-livewire-scripts.blade.php
Last active November 23, 2023 11:50
Laravel Livewire Turbolinks Blade component to keep session alive
{{-- You do not need to add this component if you are using the permanent option in the head component --}}
<script>
if (!window.sessionTimerPermanent && window.Livewire) {
window.livewire.hook('afterDomUpdate', startSessionTimer)
}
// if you are on livewire > 1.3.1 and want to avoid the default error alert
// https://github.com/livewire/livewire/pull/1146
window.livewire.onError(statusCode => {
if (statusCode === 419) {
@aibrahim3546
aibrahim3546 / calendarDates.js
Last active October 5, 2022 17:12
javascript code to generate calendar. By using this you can create your own customized calendar UI.
const daysInMonth = (iYear, iMonth) => 32 - new Date(iYear, iMonth, 32).getDate()
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
const getSelectedMonthDates = (selectedYear, selectedMonth) => {
const calendarDates = []
const firstDay = (new Date(selectedYear, selectedMonth)).getDay() // 0 = 'Sunday', 6 = 'Saturday'
const days = daysInMonth(selectedYear, selectedMonth) // how many days in a month
let x = 0
<?php
use doganoo\PHPAlgorithms\Datastructure\Sets\HashSet;
use doganoo\PHPAlgorithms\Datastructure\Stackqueue\Queue;
require_once 'vendor/autoload.php';
/*
* COMPOSER.JSON CONTENT:
* ==================================================
@geeky-sh
geeky-sh / additional.config
Last active July 2, 2019 02:12
EBExtensions db config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: main/wsgi.py
aws:elasticbeanstalk:application:environment:
STAGING: 1
DJANGO_SETTINGS_MODULE: main.settings
container_commands:
01_migrate:
command: "source /opt/python/current/env && source /opt/python/run/venv/bin/activate && cd /opt/python/current/app && ./manage.py migrate"
leader_only: true
@juniorb2ss
juniorb2ss / bitbucket-pipeline.yml
Last active June 4, 2024 11:14
Bitbucket Pipeline Deploy Laravel to Elasticbeanstalk using parallel steps
image: atlassian/default-image:2
definitions:
services:
redis:
image: redis:3.2
memory: 512
mysql:
image: mysql:5.7
environment: