Skip to content

Instantly share code, notes, and snippets.

View AminulBD's full-sized avatar

Aminul Islam AminulBD

View GitHub Profile
@AminulBD
AminulBD / NawabSMS.php
Last active October 20, 2022 05:38
Nawab SMS PHP Class
<?php
class NawabSMS
{
const ERRORS = [
'1' => 'Request has been failed.',
'101' => 'Internal server error.',
'108' => 'Wrong password or Not provided.',
'109' => 'User is not found or deleted.',
'114' => 'Content is not provided.',
@AminulBD
AminulBD / SinglePageValetDriver.php
Created November 30, 2021 09:12
Custom valet driver for SPA or static sites.
<?php
class SinglePageValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@AminulBD
AminulBD / amazon-domains.json
Created November 18, 2021 06:56
Amazon operating domains by country.
{
"us": "https://www.amazon.com",
"uk": "https://www.amazon.co.uk",
"ca": "https://www.amazon.ca",
"de": "https://www.amazon.de",
"es": "https://www.amazon.es"
"fr": "https://www.amazon.fr",
"it": "https://www.amazon.it",
"jp": "https://www.amazon.co.jp",
"in": "https://www.amazon.in",
@AminulBD
AminulBD / number-abbr.php
Last active August 2, 2021 13:22
Make number abbreviation like Trillion (T), Billion (B), Million (M), Thousand (K) etc.
<?php
/**
* Make long number as abbreviation
*
* @param float $number
*
* @return string
*/
function makeNumberAbbr(float $number): string
@AminulBD
AminulBD / readme.md
Last active December 31, 2020 18:28
Create USB Bootable MacOS Installation Disk: https://apple.stackexchange.com/a/388508

I was stuck in this very same situation for a while now and have found a way to create an install media (installing while we speak) on MacOS Catalina. A bit of Terminal magic is required, but nothing too fancy.

I will create a temporary folder on the Desktop so it is easier to inspect the structure with finder.

Steps to take to get the command running as suggested in https://support.apple.com/en-sg/HT201372

  • Download and mount the image for El Capitan (e.g. double click onto the .dmg file)
  • Open the Terminal app
  • (optional) Change to the Desktop cd ~/Desktop
  • (optional) Create a temporary folder mkdir installCapitan && cd installCapitan
@AminulBD
AminulBD / ccdl.command
Created June 17, 2020 10:30 — forked from ayyybe/ccdl.command
Adobe Offline Package Generator v0.1.2 (macOS only)
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@AminulBD
AminulBD / ubuntu.md
Last active October 8, 2018 03:39
Linux Tips & Tricks

Install Font For All Users

sudo cp -r ~/Downloads/fonts /usr/share/fonts/truetype/

Install Font For Single User

sudo cp -r ~/Downloads/fonts ~/.fonts
fc-cache -f -v
@AminulBD
AminulBD / SearchReplace.php
Last active October 3, 2018 09:28
Search and Replace all files in a directory.
<?php
class SearchReplace
{
private $src;
private $conf;
// You know what is this
public function __construct($conf)
{
$this->src = dirname(__FILE__) . '/src/';
@AminulBD
AminulBD / phpStorm-standard.xml
Last active October 15, 2018 16:16
My Coding Standard for PhpStorm.
<code_scheme name="Project" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_ATTRIBUTE_WRAP" value="0" />
<option name="HTML_TEXT_WRAP" value="0" />
<option name="HTML_ENFORCE_QUOTES" value="true" />
</HTMLCodeStyleSettings>
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
@AminulBD
AminulBD / windows-10-shortcuts.md
Last active September 29, 2018 14:27
Wndows 10 Shortcuts, Tips and Tricks

1. Powershell

  • Clear History in powershell: del (Get-PSReadlineOption).HistorySavePath
  • Set Execution Policy for current user: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  • Install Posh-Git for current user: Install-Module posh-git -Scope CurrentUser

Create Aliases

Example of artisan command:

# Artisan Alias. Example: art serve
function art {