Skip to content

Instantly share code, notes, and snippets.

View mainuljss's full-sized avatar

Mainul Islam mainuljss

  • DotsBright
  • Dhaka, Bangladesh
View GitHub Profile
@mainuljss
mainuljss / docker-compose.yml
Created December 23, 2024 17:37 — forked from hasinhayder/docker-compose.yml
Quickly deploy mysql and phpMyAdmin with this docker compose file
services:
mysql:
image: mysql:8.4.3
restart: always
ports:
- 3306:3306
volumes:
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
[2024-12-14 04:47:07] local.INFO: Response: Array
(
[attributes] => Array
(
[describeUrl] => /services/data/v48.0/analytics/reports/00ONu000004A58zMAC/describe
[instancesUrl] => /services/data/v48.0/analytics/reports/00ONu000004A58zMAC/instances
[isReportTrendedByAnyone] =>
[reportId] => 00ONu000004A58zMAC
[reportName] => Leads
[type] => Report
This file has been truncated, but you can view the full file.
[2024-12-14 03:15:20] local.INFO: Response: Array
(
[attributes] => Array
(
[describeUrl] => /services/data/v48.0/analytics/reports/00ONu000004A58zMAC/describe
[instancesUrl] => /services/data/v48.0/analytics/reports/00ONu000004A58zMAC/instances
[isReportTrendedByAnyone] =>
[reportId] => 00ONu000004A58zMAC
[reportName] => Leads
[type] => Report
Google
Chrome-Lighthouse
msnbot
Rambler
Yahoo
AbachoBOT
Accoona
AcoiRobot
ASPSeek
CrocCrawler
5.172.196.188
5.178.78.77
13.232.220.164
23.22.2.46
23.83.129.219
23.111.152.74
23.111.159.174
27.122.14.7
37.252.231.50
43.225.198.122
@mainuljss
mainuljss / EnsureQueueListenerIsRunning.php
Created October 24, 2020 19:48 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.

countTinyPairs ( 0:55:11 ) Codewriting

You are given two arrays of integers a and b of the same length, and an integer k. We will be iterating through array a from left to right, and simultaneously through array b from right to left, and looking at pairs (x, y), where x is from a and y is from b. Such a pair is called tiny if the concatenation xy is strictly less than k.

Your task is to return the number of tiny pairs that you'll encounter during the simultaneous iteration through a and b.

@mainuljss
mainuljss / google-font-download-woff2.php
Created April 27, 2020 06:17 — forked from ramsey/google-font-download-woff2.php
Downloads the .woff2 formats of the specified Google Font for the specified language types. This also creates the appropriate CSS for the downloaded font files
<?php
/**
* Downloads the .woff2 formats of the specified Google Font for the specified
* language types. This also creates the appropriate CSS for the downloaded
* font files
*
* Usage:
* php google-font-download.php 'Open Sans' ['latin-ext,latin' [/path/to/write/to]]
*/
To manually dump the database you can run the following one-liner code
mysqldump -u[user] -p[pass] [db] > [file_path]
But what if you want to automate the process, here are the steps:
1. Setup cron entry to your server
* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1
2. Create a command BackupDatabase by running the following code:
@mainuljss
mainuljss / yoast-seo-sitemap.php
Created June 25, 2019 06:30 — forked from mohandere/yoast-seo-sitemap.php
Wordpress yoast seo plugin, generate custom sitemap for custom URLS
<?php
/**
* Create a new custom yoast seo sitemap
*/
add_filter( 'wpseo_sitemap_index', 'ex_add_sitemap_custom_items' );
add_action( 'init', 'init_wpseo_do_sitemap_actions' );
// Add custom index