Skip to content

Instantly share code, notes, and snippets.

View mzaman's full-sized avatar

Masud Zaman mzaman

View GitHub Profile
@mzaman
mzaman / File_Size_Sorter_Gist.md
Created August 5, 2025 02:40
File Size Sorter (macOS Terminal)

File Size Sorter (macOS Terminal)

This script allows you to list files and folders recursively from the current directory, sort them by size in descending order, and display the file sizes in a human-readable format (KB, MB, GB, etc.) in the macOS Terminal.

Table of Contents

@mzaman
mzaman / Git-Case-Sensitivity-Issue.md
Last active April 26, 2025 05:15
Git Case Sensitivity Issue

Git Case Sensitivity Issue

Reason:

On operating systems like macOS, the file system is case-insensitive by default. Git, which relies on the underlying file system, does not differentiate between files or directories that only differ by case (e.g., Folder vs. folder).

Impact:

  • Untracked Files: Git does not track changes when directory names only differ in case.
  • Commit Issues: Git fails to register case-sensitive changes, causing incorrect tracking and missed changes.
  • Collaboration Problems: When pushing changes to a remote, other systems (e.g., Linux) with case-sensitive file systems may experience conflicts due to mismatched file names.
@mzaman
mzaman / Pulling-All-Remote-Branches-Git.md
Last active April 26, 2025 05:19
Guide to Pulling All Remote Branches and Making Them Available Locally in Git

Description:

This guide walks you through how to pull all remote branches from your Git repository and make them available locally. It covers advanced scenarios and provides useful commands to handle complex workflows, large projects, and team collaboration more efficiently.

Steps: 1. Fetch All Remote Branches: The git fetch --all command pulls all branches from all remote repositories, ensuring that your local repository is synchronized with the latest remote changes. This is especially helpful when working with multiple remotes or when you don’t want to modify your working directory immediately.

@mzaman
mzaman / remove-all-from-docker.sh
Created August 31, 2024 18:26 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@mzaman
mzaman / localStorage.js
Created February 1, 2019 22:49 — forked from anhang/localStorage.js
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}
@mzaman
mzaman / javascript-localstorage-expiry.js
Created February 1, 2019 22:47 — forked from shaik2many/javascript-localstorage-expiry.js
set timeout for localStorage or sessionStorage
http://apassant.net/2012/01/16/timeout-for-html5-localstorage/
var hours = 24; // Reset when storage is more than 24hours
var now = new Date().getTime();
var setupTime = localStorage.getItem('setupTime');
if (setupTime == null) {
localStorage.setItem('setupTime', now)
} else {
if(now-setupTime > hours*60*60*1000) {
localStorage.clear()
@mzaman
mzaman / airports.json
Created September 17, 2018 16:49 — forked from tdreyno/airports.json
JSON data for airports and their locations
This file has been truncated, but you can view the full file.
[
{
"code": "AAA",
"lat": "-17.3595",
"lon": "-145.494",
"name": "Anaa Airport",
"city": "Anaa",
"state": "Tuamotu-Gambier",
"country": "French Polynesia",
@mzaman
mzaman / index.html
Created August 15, 2018 22:07 — forked from ryanbaumann/index.html
Example of loading large geojson into Mapbox GL JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.css' rel='stylesheet' />
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
@mzaman
mzaman / isAutoplaySupported.js
Created June 26, 2018 04:04 — forked from nathansearles/isAutoplaySupported.js
Test if HTML5 video autoplay is supported
// isAutoplaySupported(callback);
// Test if HTML5 video autoplay is supported
isAutoplaySupported = function(callback) {
// Is the callback a function?
if (typeof callback !== 'function') {
console.log('isAutoplaySupported: Callback must be a function!');
return false;
}
// Check if sessionStorage exist for autoplaySupported,
// if so we don't need to check for support again
@mzaman
mzaman / BCHTML5GATracker.js
Created April 21, 2017 03:48 — forked from Daphonia/BCHTML5GATracker.js
Google Analytics Tracker Plugin for BC HTML5 Players
/**
* Brightcove HTML5 Player Google Analytics Tracker 1.0.0 Alpha (02 Sep 2012)
*
* REFERENCES:
* Website:
* Source:
*
* AUTHORS:
* Darius Oleskevicius <[email protected]>
*