Skip to content

Instantly share code, notes, and snippets.

View tuto1902's full-sized avatar

Arturo Rojas tuto1902

View GitHub Profile
@tuto1902
tuto1902 / app.css
Last active May 1, 2024 00:59
Shiki Markdown Classes
.shiki .highlight {
@apply bg-gray-600 py-1;
}
.shiki .add {
@apply bg-green-600/50 py-1 rounded-sm;
}
.shiki .del {
@apply bg-red-600/50 py-1 rounded-sm;
@tuto1902
tuto1902 / pricing.blade.php
Created March 31, 2024 04:45
Subscription Plans
<!-- Pricing -->
<div class="max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto">
<!-- Title -->
<div class="max-w-2xl mx-auto text-center mb-10 lg:mb-14">
<h2 class="text-2xl font-bold md:text-4xl md:leading-tight dark:text-white">Subscription Plans</h2>
<p class="mt-1 text-gray-600 dark:text-gray-400">Choose the plan that better fits your needs.</p>
</div>
<!-- End Title -->
<!-- Grid -->
@tuto1902
tuto1902 / chatbox.blade.php
Last active June 4, 2024 20:19
Livewire Chat Box Component
<?php
use App\Events\MessageSent;
use Livewire\Volt\Component;
new class extends Component
{
/**
* @var string[]
*/
@tuto1902
tuto1902 / theme_switcher.html
Created October 12, 2023 01:25
A theme switcher for light/dark modes
<div class="flex gap-1">
<a
class="block w-full rounded-md whitespace-nowrap px-3 py-2 text-sm font-normal text-gray-700 hover:bg-gray-100 focus:bg-gray-200 focus:outline-none active:text-zinc-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-gray-400 dark:text-gray-100 dark:hover:bg-gray-600 focus:dark:bg-gray-600"
href="#"
>
<div class="pointer-events-none">
<div class="inline-block w-[24px] text-center" data-theme-icon="light">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="inline-block h-6 w-6">
<path
d="M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1
@tuto1902
tuto1902 / settings.json
Created September 28, 2023 13:53
My VS Code Settings
{
"workbench.colorTheme": "Catppuccin Macchiato",
"editor.fontFamily": "Cascadia Code",
"editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'",
"editor.minimap.enabled": false,
"tabnine.experimentalAutoImports": true,
"workbench.sideBar.location": "right",
"php.suggest.basic": false,
"editor.quickSuggestions": {
"comments": "on",
@tuto1902
tuto1902 / carbon_time_range.md
Created August 8, 2023 04:52
Generate time range with Carbon

Create an interval collection of times between 8:00 am and 5:00 pm in 30 minute intervals

$timeStep = 30
$start = '08:00:00'
$end = '17:00:00'
$intervals = CarbonInterval::minutes($timeStep)->toPeriod($start, $end);

Use the interval collection

includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters:
paths:
- app/
level: 5
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ config('app.name') }}</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
@tuto1902
tuto1902 / validate_cron_expression.php
Created March 15, 2023 23:38
Validate a Cron expression using regex
<?php
if (!preg_match('/^(\*|[0-9,\-\/\*]+)\s+(\*|[0-9,\-\/\*]+)\s+(\*|[0-9,\-\/\*]+)\s+(\*|[0-9,\-\/\*]+)\s+(\*|[0-9,\-\/\*]+)$/', $cronExpression)) {
// Invalid expression
}
<svg class="animate-spin ml-2 mr-2 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>