This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are just instructions with list of commands needs to be followed to install Lamp stack with Apache, php 5.6, mysql 5.6. This configured for prestashop 1.6 installation | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt upgrade | |
sudo apt install apache2 php5.6 curl git unzip libapache2-mod-php5.6 php5.6-mysql php5.6-curl php5.6-cli php5.6-common php5.6-json php5.6-opcache php5.6-mysql php5.6-mbstring php5.6-zip php5.6-fpm php5.6-intl php5.6-simplexml php5.6-apcu php5.6-cli php5.6-memcached php5.6-pdo php5.6-zip php5.6-gd php5.6-xml php5.6-soap | |
sudo a2dismod php8.2 | |
sudo a2enmod php5.6 | |
sudo update-alternatives --config php | |
sudo a2enmod headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update && sudo apt upgrade | |
sudo apt install software-properties-common && sudo add-apt-repository ppa:ondrej/php && sudo apt update | |
# https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html | |
sudo apt install php7.4-fpm php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-soap php7.4-zip php7.4-bcmath php7.4-xsl php7.4-mysql php7.4-mbstring php7.4-intl -y | |
sudo apt install libsodium-dev | |
sudo pecl install -f libsodium | |
sudo apt install apache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# heavily inspired by https://gist.github.com/rbellamy/3c5033ba605a090824e8 | |
# gets everything from bitbucket and brings it across to GH, adding LFS where necessary for file size | |
# then archives everything brought over | |
# | |
# runs on Python 3; does clone --mirror and push --mirror, cleaning up after itself | |
# | |
# you need git-lfs installed on the local system | |
# also make sure you've got git credential caching set up https://help.github.com/articles/caching-your-github-password-in-git/ | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var facebookLinks = function () { | |
var detectOs = { | |
getUserAgent: function () { | |
return navigator.userAgent; | |
}, | |
getPlatform: function () { | |
return navigator.platform; | |
}, | |
isIos: function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const detectOs = { | |
getUserAgent: () => { | |
return navigator.userAgent; | |
}, | |
getPlatform: () => { | |
return navigator.platform; | |
}, | |
isIos: () => { | |
return /iPhone|iPad|iPod/.test(detectOs.getPlatform()); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class downloadGoogleDriveImage { | |
public static function download_external_url_by_post_id($post_id, $meta_keys){ | |
$result = []; | |
foreach($meta_keys as $meta_key){ | |
$url = trim(get_post_meta($post_id, $meta_key, true)); | |
if(empty($url)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function(){ | |
if(jQuery(".countdown h3 span") === 0 ){ | |
return; | |
} | |
jQuery(".countdown h3 span").each(function(){ | |
// Set the date we're counting down to | |
var element = jQuery(this); | |
var countDownDate = new Date(jQuery(this).text()).getTime(); | |
// Update the count down every 1 second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
# Block suspicious user agents and requests | |
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} (;|<|>|'|"|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR] | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR] | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR] | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR] | |
RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt update | |
apt upgrade | |
apt install apache2 | |
a2enmod headers rewrite | |
systemctl restart apache2 | |
sudo ufw allow in "Apache" | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyToClipboard(textToCopy) { | |
var textArea; | |
function isOS() { | |
//can use a better detection logic here | |
return navigator.userAgent.match(/ipad|iphone/i); | |
} | |
function createTextArea(text) { | |
textArea = document.createElement('textArea'); |
NewerOlder