Skip to content

Instantly share code, notes, and snippets.

View mayeenulislam's full-sized avatar
🤖
AI won't replace you

Mayeenul Islam mayeenulislam

🤖
AI won't replace you
View GitHub Profile
@mayeenulislam
mayeenulislam / privateGPT.md
Created March 22, 2024 05:41
Installing PrivateGPT on an Apple M3 Mac

Installing PrivateGPT on an Apple M3 Mac

# clone the repo and get into it
git clone https://github.com/imartinez/privateGPT && cd privateGPT

# install Python 3.11
pyenv install 3.11

# install make for running various scripts
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'put your unique phrase here');
@mayeenulislam
mayeenulislam / app.css
Last active January 20, 2023 08:42
Multiple columns using PHP Loop
.test{
color: red;
font-size: 16px;
}
.content-body{
font-family: 'Siyam Rupali', 'SolaimanLipi', Vrinda, Arial, Helvetica, sans-serif;
font-size: 16px;
box-shadow: inset 1px -1px 1px #444,inset -1px 1px 1px #444; /* to make a border-like appearance */
width: 100%; /* to get the full width */
@mayeenulislam
mayeenulislam / css-tooltip.css
Last active January 20, 2023 06:08
CSS Tooltip and <acronym> tag
abbr {
position: relative;
cursor: pointer;
}
abbr:hover::after {
content: attr(title);
position: absolute;
white-space: nowrap;
background-color: #666;
@mayeenulislam
mayeenulislam / find-hidden-fields-blocking-foms.html
Created July 31, 2022 04:57
Find the hidden fields hidden, and are blocking the form submission. Source: cannot remember
<html>
<body>
<form id="my-form-id-here">
<input type="text" style="display: none"><br/>
<input type="text">
<button type="submit">Submit</button>
</form>
<script>
var targetForm = document.getElementById('my-form-id-here');
@mayeenulislam
mayeenulislam / english_to_bangla.js
Last active February 24, 2022 10:55 — forked from sharif2008/english_to_bangla.js
Converting English number to Bangla in Javascript
var finalEnlishToBanglaNumber={'0':'০','1':'১','2':'২','3':'৩','4':'৪','5':'৫','6':'৬','7':'৭','8':'৮','9':'৯'};
String.prototype.getDigitBanglaFromEnglish = function() {
var retStr = this;
for (var x in finalEnlishToBanglaNumber) {
retStr = retStr.replace(new RegExp(x, 'g'), finalEnlishToBanglaNumber[x]);
}
return retStr;
};
@mayeenulislam
mayeenulislam / truncateAmount.php
Last active September 5, 2021 06:02
Truncate amount in Indian money format like Lakh, Koti (Lac, Crore), and in US money format like Million, Billion, Trillion etc.
<?php
/**
* Truncate Amount (in Indian format).
*
* Return amount in lac/koti etc.
*
* @param integer $amount Amount.
*
* @link https://stackoverflow.com/q/42571702/1743124 (Concept)
*
@mayeenulislam
mayeenulislam / file-upload.html
Last active June 4, 2020 11:01
This is a demonstration (aka demo) of the setup of jQuery File Upload in a standalone file input. We're *not using* the `UI version` and the default validation was not working for us, so we ditched those and followed community provided raw checkup. Thanks to the StackOverflow thread for guiding to achieve my need: https://stackoverflow.com/q/174…
<!--
jQuery File Upload UI
jQuery File Upload is a huge plugin with a lot of functionalities.
And that made this a bit complex to find out how to implement a
basic upload feature like:
1. Multiple file upload
2. Validate on file types
3. Validate on file size
@mayeenulislam
mayeenulislam / install-wp-plugins.php
Created January 24, 2020 04:16 — forked from squarestar/install-wp-plugins.php
Programmatically install and activate wordpress plugins
<?php
/**
* Programmatically install and activate wordpress plugins
*
* Usage:
* 1. Edit the $pluginSlugs array at the beginning of this file to include the slugs of all the
* plugins you want to install and activate
* 2. Upload this file to the wordpress root directory (the same directory that contains the
* 'wp-admin' directory).
* 3. Navigate to <your-domain-wordpress-root>/install-wp-plugins.php (If wordpress is installed
@mayeenulislam
mayeenulislam / command.sh
Last active February 11, 2020 11:27
Shell commands for Files utilities
# file mime type
file -b --mime-type 'filename has space in it.flv'
# Create dummy file with any defined size with valid mime_type
# file size in binary bytes
fsutil file createnew myfile.pdf 10485760
# Source: https://www.digitalcitizen.life/3-ways-create-random-dummy-files-windows-given-size
# Helpful converter: https://www.gbmb.org/