Skip to content

Instantly share code, notes, and snippets.

View M-Abdullahi's full-sized avatar
:octocat:
Available

M. Abdullahi M-Abdullahi

:octocat:
Available
View GitHub Profile
@ngokevin
ngokevin / serviceworker.js
Last active March 12, 2023 09:52
Service Worker Template - cache-else-network + network-else-cache
var VERSION = 'v1';
var cacheFirstFiles = [
// ADDME: Add paths and URLs to pull from cache first if it has been loaded before. Else fetch from network.
// If loading from cache, fetch from network in the background to update the resource. Examples:
// 'assets/img/logo.png',
// 'assets/models/controller.gltf',
];
@jarektkaczyk
jarektkaczyk / laravel-wheres-orWheres.php
Last active December 19, 2023 14:54
overlapping periods scope + how to nest orWhere in laravel query builder
<?php
// Freek posted a query today, that drives OhDearApp filters (the app recommended!):
// @link https://twitter.com/freekmurze/status/972299131497713664
// We can make the query more eloquent, so why don't we use a scope!
// I
// Let's make it really eloquent and get here:
$site->downtimePeriods()
@unr
unr / AppLayout.js
Created October 16, 2018 21:12
Bare Minimum Laravel Echo in Nuxt.JS example.
// In my global app layout, once my app is mounted and ready to listen...
import { mapActions, mapGetters } from 'vuex';
const Layout = {
mounted() {
// set up pusher listeners
this.connectToPublicChannel();
this.$watch('authenticated', (auth) => {
if (auth) this.connectToUserChannel();