Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar
🏠
Working from home

Md. Sumon Islam sumonst21

🏠
Working from home
View GitHub Profile
@sumonst21
sumonst21 / http-redirect-target.php
Created March 24, 2019 15:20
Get HTTP redirect destination for a URL in PHP
<?php
// FOLLOW A SINGLE REDIRECT:
// This makes a single request and reads the "Location" header to determine the
// destination. It doesn't check if that location is valid or not.
function get_redirect_target($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
@sumonst21
sumonst21 / perms.md
Created March 26, 2019 00:49 — forked from stefanbc/perms.md
Set proper permissions on /var/www/

HOWTO

To set up permissions on /var/www where your files are served from by default:

sudo addgroup webmasters
sudo adduser $USER webmasters
sudo chown -R root:webmasters /var/www
sudo find /var/www -type f -exec chmod 664 {} \;
sudo find /var/www -type d -exec chmod 775 {} \;
@sumonst21
sumonst21 / bootstrap-4-datatable-export.markdown
Created April 1, 2019 22:03
bootstrap 4 datatable export
@sumonst21
sumonst21 / fancy-pills-navigation-effect.markdown
Created April 4, 2019 01:41
Fancy pills navigation effect
@sumonst21
sumonst21 / index.html
Created April 4, 2019 01:42
✅ Springy Switchbox | Checkbox toggle animation | @keyframers 2.0.0
<a href="https://youtu.be/VOmlp4k5T0A" target="_blank" data-keyframers-credit style="color: #444"></a>
<script src="https://codepen.io/shshaw/pen/QmZYMG.js"></script>
<div id="app">
<label class="checker">
<input class="checkbox" type="checkbox" />
<div class="check-bg"></div>
<div class="checkmark">
<svg viewBox="0 0 100 100">
<path d="M20,55 L40,75 L77,27" fill="none" stroke="#FFF" stroke-width="15" stroke-linecap="round" stroke-linejoin="round" />
@sumonst21
sumonst21 / index.html
Created April 4, 2019 01:47
Reusable, Responsive Grids 1/2, 3/3, 2/3 & 1/3 All CSS
<div class="container">
<header>header</header>
<div class="grid-wrapper">
<article class="half-left">
Left half
</article>
<article class="half-right">
Right half
</article>
</div>
@sumonst21
sumonst21 / multiple-php.txt
Created April 9, 2019 18:10 — forked from anwas/multiple-php.txt
[Multiple PHP versions on Ubuntu]
## Add repository
### https://launchpad.net/%7Eondrej/+archive/ubuntu/php
### https://launchpad.net/~ondrej/+archive/ubuntu/apache2
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get dist-upgrade
@sumonst21
sumonst21 / pidoa.php
Created April 11, 2019 10:59 — forked from tzi/pidoa.php
Pidoa - Rename TV shows files automatically
<?php
function usage( $argv ) {
echo PHP_EOL .
'Pidoa' . PHP_EOL .
'------------' . PHP_EOL .
'This script allow you to rename tv shows easily' . PHP_EOL .
PHP_EOL .
'Usage: php ' . $argv[ 0 ] . ' <folder_path> <pattern>' . PHP_EOL .
'Example: php ' . $argv[ 0 ] . ' ./ "Babylon 5 S%Sx%E %V"' . PHP_EOL .
@sumonst21
sumonst21 / README.md
Created April 11, 2019 19:09 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8