Skip to content

Instantly share code, notes, and snippets.

View alazar-tekle's full-sized avatar

Alazar Tekle alazar-tekle

  • BAME | PAMPay | GATCo
  • Ethiopia
  • X @al3mu
View GitHub Profile
@echr
echr / app.js
Last active November 23, 2023 12:05
Simple Laravel + Vue + Laravel Mix + Firebase Notification (PWA, Offline)
// FILE PATH: /resources/js/app.js
require('./bootstrap');
// Import Service Worker Registry
require('./extensions/sw-registry');
import Vue from 'vue';
...

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@azimidev
azimidev / calculate_profile_percentage.php
Last active July 11, 2022 01:51
Calculates how much percentage of a profile is completed. It stripes off timestamps like created_at updated_at and primary keys like ids. Usually beneficial when using Laravel
<?php
/**
* Calculate how much a profile is completed
*
* @param $profile
* @return float|int
*/
function calculate_profile($profile)
{
if ( ! $profile) {