Skip to content

Instantly share code, notes, and snippets.

View mrabbani's full-sized avatar
🎯
Focusing

Mahbub Rabbani mrabbani

🎯
Focusing
View GitHub Profile

Open a new page in a new window, print it and closed it stackoverflow

<script type='text/javascript'>
  $(function(){
    function openPrintWindow(url, name, specs) {
      var printWindow = window.open(url, name, specs);
      var printAndClose = function () {
        if (printWindow.document.readyState == 'complete') {
          clearInterval(sched);

printWindow.print();

@mrabbani
mrabbani / openssl.md
Last active November 4, 2020 16:34
Open Ssl Configuration
@mrabbani
mrabbani / mysql_tricks.md
Last active November 5, 2019 05:39
Mysql tricks

MySql fetch data by conditional order

Suppose, You want to search product with specified key and the products with stock should appear first in the search result.

SELECT * FROM `products` WHERE name LIKE 'na%'
ORDER BY CASE
    WHEN id IN (602, 603, 18125) THEN 1
    ELSE 2
END, name ASC
@mrabbani
mrabbani / laravel envoy.md
Last active November 4, 2020 02:10
Server Deployment
@mrabbani
mrabbani / Laravel Task Scheduling config.md
Last active April 4, 2017 03:54
Laravel task scheduling configuration

Introduction

When you will read about Laravel Task Scheduling, you may confuse how to add Cron entries to your server. This section will help you to rosolve your confusion.

Let's assume your project name is MyBlog and the location of your project is /var/www/MyBlog.

Configuration

  • open your terminal and run crontab -e
  • add * * * * * php /var/www/MyBlog/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1 at the bottom then save and exit.
@mrabbani
mrabbani / mailgun-config.md
Last active January 8, 2024 01:45
Laravel Mailgun Setup
@mrabbani
mrabbani / modal.md
Last active November 5, 2023 15:20
Bootstrap Modal Re-use in Laravel