Skip to content

Instantly share code, notes, and snippets.

View bhaidar's full-sized avatar

Bilal Haidar bhaidar

View GitHub Profile
<script setup>
import { reactive, onMounted } from 'vue';
const props = defineProps({
is: String,
icons: Array,
});
const list = reactive({});
@JordanDalton
JordanDalton / helpers.php
Created February 19, 2023 14:28
Pipeline Helper / Wrapper
<?php
if( ! function_exists('pipe')) {
function pipe($payload, $steps = [])
{
return app(\Illuminate\Pipeline\Pipeline::class)
->send($payload)
->through($steps)
@stevebauman
stevebauman / FilesystemMockProvider.php
Created February 17, 2023 17:19
Filesystem Cloud Mocking
<?php
namespace App\Providers;
class FilesystemMockProvider extends ServiceProvider
{
public function boot()
{
if (App::isProduction()) {
return;
@bhaidar
bhaidar / PieChartSvg.vue
Created January 17, 2023 22:00 — forked from marwinious/PieChartSvg.vue
SVG Pie Chart Component for Vue.js
/*
Initial concept from: https://seesparkbox.com/foundry/how_to_code_an_SVG_pie_chart
Vue.js component by Darius Babcock
*/
<template>
<div class="pie_chart_svg_container">
<svg
:height="diameter"
:width="diameter"
@PovilasKorop
PovilasKorop / index.php
Created February 14, 2022 06:24
PHP NumberFormatter Demo
<?php
function getFormattedNumber(
$value,
$locale = 'en_US',
$style = NumberFormatter::DECIMAL,
$precision = 2,
$groupingUsed = true,
$currencyCode = 'USD',
) {
@onlime
onlime / .eslintrc.js
Last active April 29, 2024 20:35
ESLint/Prettier config for Vue 3 in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'prettier'
@bhaidar
bhaidar / vue.md
Last active December 18, 2021 18:29 — forked from DawidMyslak/vue.md
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@bhaidar
bhaidar / pivot-tables.md
Created April 14, 2021 22:14 — forked from Braunson/pivot-tables.md
Laravel 8.x - Diving into Pivot Tables

Laravel 6 - Diving Into Pivot Tables

Pivot tables can be confusing and a little hard to wrap your head around at first. In this quick article we are going to dive into what a pivot table is, how to create one and finally how to use the pivot table. Let's dive in!

What is a pivot table?

A pivot table is used to connect relationships between two tables. Laravel provides a Many To Many relationship where you can use a pivot table.

@CraigGoesCoding
CraigGoesCoding / laravel-worker.conf
Created January 19, 2021 13:41
Supervisor configuration for running queues on Laravel Homestead
; see YouTube video: https://youtu.be/T9hfgkKgKOU
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/project_folder/artisan queue:listen --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=vagrant
@sam-ngu
sam-ngu / Composer.php
Created November 10, 2020 01:40
Laravel helper class to run composer command programmatically.
<?php
namespace App;
class Composer extends \Illuminate\Support\Composer
{
public function run(array $command)
{