Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Fahad Ali Khan fhdalikhan

🏠
Working from home
  • Karachi, Pakistan.
View GitHub Profile
@fhdalikhan
fhdalikhan / help.js
Created Jul 23, 2020
Bootstrap modal scroll to top with animation
View help.js
$('.modal').animate({ scrollTop: 0 }, 'slow');
@fhdalikhan
fhdalikhan / help.js
Created Jul 23, 2020
jQuery Scroll to top with animation duration and based on target div
View help.js
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#myDiv").offset().top
}, 2000);
});
View backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');
@fhdalikhan
fhdalikhan / Dockerfile
Last active May 29, 2020
Dockerfile for PHP 7.3 FPM Alpine
View Dockerfile
FROM php:7.3-fpm-alpine
WORKDIR /var/www/html
# Setup GD extension
RUN apk add --no-cache \
freetype \
libjpeg-turbo \
libpng \
freetype-dev \
@fhdalikhan
fhdalikhan / Dockerfile
Last active May 29, 2020
Dockerfile for PHP 7.1 FPM Alpine
View Dockerfile
FROM php:7.1-fpm-alpine
WORKDIR /var/www/html
# Setup GD extension
RUN apk add --no-cache \
freetype \
libjpeg-turbo \
libpng \
freetype-dev \
@fhdalikhan
fhdalikhan / Dockerfile
Last active May 29, 2020
Dockerfile for PHP 7.4 FPM Alpine
View Dockerfile
FROM php:7.4-fpm-alpine
WORKDIR /var/www/html
# Setup GD extension
RUN apk add --no-cache \
freetype \
libjpeg-turbo \
libpng \
freetype-dev \
View docker-cmds.txt
# to create a build
docker-compose build
# to run containers in detached mode
docker-compose up -d
# to stop containers
docker-compose down
# to push a new tag to the repository,
View stripe-form.html
<style>
/**
* The CSS shown here will not be introduced in the Quickstart guide, but shows
* how you can use CSS to style your Element's container.
*/
.StripeElement {
box-sizing: border-box;
height: 40px;
@fhdalikhan
fhdalikhan / SubscriptionController.php
Created May 20, 2020
Stripe Subscription Controller
View SubscriptionController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use Carbon\Carbon;
use App\PaymentSripeSubscription;
use Stripe\Stripe;
use Stripe\Product;
@fhdalikhan
fhdalikhan / table-search.html
Created Apr 12, 2020
Search inside table example
View table-search.html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div class="second">
<div class="container">
<div class="row">
You can’t perform that action at this time.