Skip to content

Instantly share code, notes, and snippets.

View mra-dev's full-sized avatar

M_R_A mra-dev

View GitHub Profile
@mra-dev
mra-dev / StaticHtmlValetDriver.php
Created March 5, 2023 01:23
Laravel Valet Driver - Serving Html Files with Pretty URL (I Used it with a Quasar Project)
<?php
class SampleValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@mra-dev
mra-dev / TimeHelper.js
Last active June 26, 2022 16:15
JavaScript seconds to time string with format hh:mm:ss
// As the name of the function says; It converts seconds to time(clock) format. (Useful for OTP authentication)
const secondsToTime = seconds => {
let h = Math.floor(seconds / 3600).toString().padStart(2, '0'),
m = Math.floor(seconds % 3600 / 60).toString().padStart(2, '0'),
s = Math.floor(seconds % 60).toString().padStart(2, '0')
// Returns only 00:00 format if hour is not set. (optional)
if (h === '00')
return `${m}:${s}`
@mra-dev
mra-dev / GridTable.vue
Last active March 23, 2022 01:05
Simple fully customized grid table using TailwindCss in Vue 3 (Composition API)
<script setup>
import {computed, onMounted, ref} from "vue";
const props = defineProps({
items: {
type: Object,
default: {
headers: {},
data: []
},