Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Back on track, yayyyy!

Hasin Hayder hasinhayder

🚀
Back on track, yayyyy!
View GitHub Profile
@hasinhayder
hasinhayder / DNS_TO_LOCALHOST.markdown
Created Feb 10, 2021 — forked from tinogomes/DNS_TO_LOCALHOST.markdown
Public DNS Pointing To localhost (127.0.0.1)
View DNS_TO_LOCALHOST.markdown

Available Wildcarded DNS Domains

It turns out that some kind hearted people already set up wildcarded domains for you already. You can use any domain below and/or any subdomain of these and they will always resolve back to 127.0.0.1 (your local machine). Here's the list of ones I know about. Let me know if there are more!

  • localhost - It will always works. Do you know why? I hope so.
  • [*.]fuf.me - Managed by @fidian; it will always point to localhost for IPv4 and IPv6
  • [*.]localtest.me
  • [*.]127-0-0-1.org.uk
  • [*.]vcap.me
  • [*.]yoogle.com
@hasinhayder
hasinhayder / elementor-assign-category-snippet.php
Created Dec 13, 2020 — forked from obiPlabon/elementor-assign-category-snippet.php
Asssign any elementor widget to a different category
View elementor-assign-category-snippet.php
<?php
/**
* Asssign any elementor widget to a different category
*
* To override the existing category just pass [ 'your-custom-category' ]
* And to keep existing [ 'your-custom-category', 'basic' ]
* here 'your-custom-category' is any registered category slug
*
* @param array $config
@hasinhayder
hasinhayder / elementor-disable-all-wp-widgets.php
Created Dec 12, 2020 — forked from obiPlabon/elementor-disable-all-wp-widgets.php
Disable or remove elementor widget from editor panel
View elementor-disable-all-wp-widgets.php
<?php
/**
* Disable elementor registered widget.
*
* This will disable all WordPress native widgets
*
* @param \Elementor\Widgets_Manager $widgets_manager Instance of elementor widgets manager
*
* @author obiPlabon <https://obiPlabon.im>
*
@hasinhayder
hasinhayder / solution.js
Last active Oct 6, 2020
Extracting data and flattening it from a multi dimensional array
View solution.js
//data source = https://gist.github.com/hasinhayder/7352ac2d76660862061ffdd0d963711e
const videos = course.data.chapters
.map((chapter) => chapter.episodes.map((episode) => episode.vid))
.flat()
//Another solution (By Shadman Shadab)
const videos = course.data.chapters
.flatMap((chapter) => chapter.episodes.map((episode) => episode.vid))
@hasinhayder
hasinhayder / VirtualHost.conf
Created Jun 6, 2020
Apache Header Cache Control
View VirtualHost.conf
<VirtualHost *:80>
DocumentRoot (Your root folder here)
ServerName (ServerName Details Here)
..
<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|svg)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
..
</VirtualHost>
@hasinhayder
hasinhayder / .htaccess
Last active Oct 9, 2020
Apache Deflate
View .htaccess
<ifmodule mod_deflate.c>
#DeflateCompressionLevel 9
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
@hasinhayder
hasinhayder / .htaccess
Created Jun 6, 2020
Apache Browser Cache
View .htaccess
### marker BROWSER CACHE start ###
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/pdf A31557600
ExpiresByType image/x-icon A31557600
ExpiresByType image/vnd.microsoft.icon A31557600
ExpiresByType image/svg+xml A31557600
ExpiresByType image/jpg A31557600
ExpiresByType image/jpeg A31557600
View install-wpcli.sh
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
@hasinhayder
hasinhayder / admin-ssl-vesta.sh
Last active Feb 13, 2021
Install Admin Panel SSL Cert for VestaCP using LetsEncrypt
View admin-ssl-vesta.sh
v-change-sys-hostname somedomain.com
v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'yes'
# v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'no'#mail domain = no
v-update-host-certificate admin $HOSTNAME
echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf
@hasinhayder
hasinhayder / php-7.0-template-deb-9.sh
Last active Jun 1, 2020
PHP Templates in Debian 9 + VestaCP
View php-7.0-template-deb-9.sh
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list'
apt-get update
a2enmod proxy_fcgi setenvif
apt-get install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip
update-rc.d php7.0-fpm defaults