Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Sohel Rana sohelrana820

💭
I may be slow to respond.
View GitHub Profile
@sohelrana820
sohelrana820 / OrdinaryCarsController.php
Last active Jul 12, 2022
Delete file after download
View OrdinaryCarsController.php
```php
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $zip['name']);
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
//header('Content-Length: ' . $size);
@sohelrana820
sohelrana820 / expression.txt
Created Jun 21, 2022
Regular Expression for Validating Bangladeshi Mobile number
View expression.txt
Regulat Expression Patter: ^(?:\\+?\\+880|880|0)?1\d{9}$
Input:
============
01711091770
00711091770
1711091770
8801711091770
881711091770
@sohelrana820
sohelrana820 / minio-commands.md
Last active Jul 7, 2022 — forked from a-h-abid/example.lifecycle.json
MinIO MC Commands Quick Sheet
View minio-commands.md

MinIO Commands

## Alias to Minio Server
mc alias set myminio http://localhost:9000 <access-key> <secret-key>

## List Directories (Root Buckets + Directories)
mc ls myminio
mc ls myminio bucket/folder
@sohelrana820
sohelrana820 / html-to-pdf.html
Last active Jul 3, 2022
HTML to PDF using jQuery
View html-to-pdf.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML to PDF</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<main>
@sohelrana820
sohelrana820 / is_domain_contain.php
Created Mar 12, 2021
Check text string contain domain ot not.
View is_domain_contain.php
<?php
/**
* This function will check the text and find the domain name from test.
* If any domain found then it will validate domain name. If domain valid
* then return true otherwise return false.
*
* @param $textString
* @return bool
*/
View GoogleVisionApi.php
<?php
namespace app\Components;
use Vision\Annotation\SafeSearchAnnotation;
use Vision\Request\Image\Base64Image;
use Vision\Vision;
/**
@sohelrana820
sohelrana820 / XMLRPCClient.php
Created Sep 17, 2018
XML RPC Client Example
View XMLRPCClient.php
<?php
/**
* Class XMLRPCClient
*/
class XMLRPCClient
{
/**
* @var
*/
@sohelrana820
sohelrana820 / print_external_page_without_opening_it.html
Created Sep 16, 2018
Print an external page without opening it
View print_external_page_without_opening_it.html
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MDN Example</title>
<script type="text/javascript">
function closePrint () {
document.body.removeChild(this.__container__);
}
@sohelrana820
sohelrana820 / xero-html-template-navbar.html
Created Sep 9, 2018
Fixed Navbar of XERO HTML Template
View xero-html-template-navbar.html
<header class="main-header sticky-header" id="main-header-2">
<div class="container">
<div class="row">
<div class="col-12">
<nav class="navbar navbar-expand-lg navbar-light rounded">
<a class="navbar-brand logo mr-auto" href="index.html">
<img src="assets/img/logos/black-logo.png" alt="logo">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="fa fa-bars"></span>
@sohelrana820
sohelrana820 / phpunit.xml
Created Jul 18, 2018
PHPUNIT.XML configuration for CakePHP 3
View phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
backupGlobals="true"
>