Skip to content

Instantly share code, notes, and snippets.

View lokmanm's full-sized avatar
🌍
Working everywhere

Lokman Musliu lokmanm

🌍
Working everywhere
View GitHub Profile
@lokmanm
lokmanm / components.blade.php
Last active November 21, 2024 12:32
Blade Components
{{-- Tabs --}}
<x-tabs defaultValue="year">
<x-tabs-list>
<x-tabs-trigger icon="chart-bar" value="year">Charts by year</x-tabs-trigger>
<x-tabs-trigger icon="trending-up" value="trends">Trends</x-tabs-trigger>
</x-tabs-list>
<x-tabs-content value="year"> Chart for Year </x-tabs-content>
<x-tabs-content value="trends"> Chart for Trends </x-tabs-content>
</x-tabs>
@lokmanm
lokmanm / svgo.config.mjs
Created March 13, 2024 22:50
SVGO Config
export default {
gzip: true,
multipass: false,
transformPrecision: '5',
floatPrecision: '3',
pretty: false,
plugins: [
'removeDoctype',
'removeXMLProcInst',
'removeComments',
@lokmanm
lokmanm / ImportWp.php
Last active December 22, 2021 15:04
Import Wordpress posts to Statamic
<?php
namespace App\Console\Commands;
use Corcel\Model\Post;
use Corcel\Model\Category;
use Corcel\Model\Taxonomy;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Statamic\Facades\Entry;
@lokmanm
lokmanm / lead.antlers.html
Last active December 22, 2021 19:39
Reusable Antlers component
---
sizes:
sm: 'text-sm'
md: 'text-base'
lg: 'text-lg'
weights:
normal: 'font-normal'
bold: 'font-bold'
medium: 'font-medium'
types:
@lokmanm
lokmanm / commands.bash
Created December 21, 2021 13:14
Switching PHP Versions in Valet
valet stop
brew unlink php@7.0 php@7.1 php@7.2 php@7.3 php@7.4
brew link --force --overwrite php@7.4
brew services start php@7.4
composer global update
rm -f ~/.config/valet/valet.sock
valet install
@lokmanm
lokmanm / Laravel.php
Last active December 30, 2019 18:01
Laravel Snippets
<?php
/**
* How to properly iterate a relationship
* and map only select fields.
*
*/
$organizations => Auth::user()->account->organizations()
->orderBy('name')
->get()