Skip to content

Instantly share code, notes, and snippets.

View md-riaz's full-sized avatar
👨‍💻
PHP Developer

MD Riaz md-riaz

👨‍💻
PHP Developer
View GitHub Profile
@md-riaz
md-riaz / loadThen.js
Created April 3, 2019 09:27 — forked from bill-barron/loadThen.js
An alternative to jQuery's ajax load() function that has the same interface except it does not take a callback function, bit instead it returns a promise.
(function ($) {
var _loadThen = $.fn.loadThen;
/**
* An alternative to jQuery's ajax load() function that has the same interface
* except it does not take a callback function, but instead it returns a promise.
* The promise will be resolved when the content are loaded into the set of matched elements.
* @param url {string} A string containing the URL to which the request is sent.
* @param params {object or string} A plain object or string that is sent to the server with the request.
* @returns {jQuery Promise} with params (html, status, jqXHR).
@md-riaz
md-riaz / vscode_shortcuts.md
Created April 3, 2020 18:59 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@md-riaz
md-riaz / JqueryActive.html
Last active September 1, 2020 07:59
Add Active Navigation Class Based on URL
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about/">About</a></li>
<li><a href="/clients/">Clients</a></li>
<li><a href="/contact/">Contact Us</a></li>
</ul>
</nav>
<script>
/* ===============
MIXINS
=============== */
@mixin spacingUtilites($spacers, $directions, $breakpoints) {
@each $breakpoint_name, $breakpoint in $breakpoints {
@if ($breakpoint == 0) {
$breakpoint_name: "";
@include spacingProperties($spacers, $directions, $breakpoint_name);
} @else {
/* ===============
MIXINS
=============== */
@mixin flexProperties($prefix) {
.d#{$prefix}-flex {
display: flex !important;
}
.flex#{$prefix}-row {
flex-direction: row !important;
}
@md-riaz
md-riaz / cloudSettings
Last active December 28, 2020 07:04
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-12-13T04:12:16.517Z","extensionVersion":"v3.4.3"}
@md-riaz
md-riaz / fontawesome5-php-array.php
Created January 4, 2021 09:56 — forked from smartcatdev/fontawesome5-php-array.php
Font Awesome 5 - Icon PHP Array
function fa_icons() {
return array (
'fab fa-500px' => __( '500px', 'buildr' ),
'fab fa-accessible-icon' => __( 'accessible-icon', 'buildr' ),
'fab fa-accusoft' => __( 'accusoft', 'buildr' ),
'fas fa-address-book' => __( 'address-book', 'buildr' ),
'far fa-address-book' => __( 'address-book', 'buildr' ),
'fas fa-address-card' => __( 'address-card', 'buildr' ),
'far fa-address-card' => __( 'address-card', 'buildr' ),
@md-riaz
md-riaz / FontAwesome-v5.0.9-Free.json
Created January 5, 2021 03:47 — forked from sakalauskas/FontAwesome-v5.0.9-Free.json
List of all Font Awesome 5 icons in JSON Cheetsheet
{
"fas fa-address-book","fas fa-address-card","fas fa-adjust","fas fa-align-center","fas fa-align-justify","fas fa-align-left","fas fa-align-right","fas fa-allergies","fas fa-ambulance","fas fa-american-sign-language-interpreting","fas fa-anchor","fas fa-angle-double-down","fas fa-angle-double-left","fas fa-angle-double-right","fas fa-angle-double-up","fas fa-angle-down","fas fa-angle-left","fas fa-angle-right","fas fa-angle-up","fas fa-archive","fas fa-arrow-alt-circle-down","fas fa-arrow-alt-circle-left","fas fa-arrow-alt-circle-right","fas fa-arrow-alt-circle-up","fas fa-arrow-circle-down","fas fa-arrow-circle-left","fas fa-arrow-circle-right","fas fa-arrow-circle-up","fas fa-arrow-down","fas fa-arrow-left","fas fa-arrow-right","fas fa-arrow-up","fas fa-arrows-alt","fas fa-arrows-alt-h","fas fa-arrows-alt-v","fas fa-assistive-listening-systems","fas fa-asterisk","fas fa-at","fas fa-audio-description","fas fa-backward","fas fa-balance-scale","fas fa-ban","fas fa-band-aid","fas fa-barcode","fas fa-bars",
<?php
$menu_array = [
[
'id' => 1,
'nav_name' => 'test/',
'parent_id' => 0
],
[
'id' => 2,
'nav_name' => 'test1/',
function formatBytes(a,b=2){if(0===a)return"0 Bytes";const c=0>b?0:b,d=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,d)).toFixed(c))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][d]}