Skip to content

Instantly share code, notes, and snippets.

View lukapaunovic's full-sized avatar
🎯
Focusing

Luka Paunović lukapaunovic

🎯
Focusing
  • Serbia
  • 04:58 (UTC +02:00)
View GitHub Profile
location ~* /wp-content/resources/.*\.(js|css)$ {
try_files $uri $uri/ /wp-content/autoptimize_404_handler.php;
}
# WebP Express rules
# --------------------
location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
add_header Vary Accept;
expires 365d;
if ($http_accept !~* "webp"){
break;
}
try_files
/wp-content/webp-express/webp-images/doc-root/$uri.webp
<!-- Hotjar Tracking Code for https://yazolewatches.com/ -->
<script>
jQuery(document).ready(function(c){window.cbload232="no",c(window).scroll(function(){var n,t,o,e;1<c(document).scrollTop()&&"no"==window.cbload232&&(window.cbload232="yes",n=window,t=document,n.hj=n.hj||function(){(n.hj.q=n.hj.q||[]).push(arguments)},n._hjSettings={hjid:1187058,hjsv:6},o=t.getElementsByTagName("head")[0],(e=t.createElement("script")).async=1,e.src="https://static.hotjar.com/c/hotjar-"+n._hjSettings.hjid+".js?sv="+n._hjSettings.hjsv,o.appendChild(e))})});
</script>
@lukapaunovic
lukapaunovic / gist:6869d3e01be95ac2daa67587898a2db5
Created April 21, 2018 14:28
fix-ownership-permissions.sh
#!/bin/bash
echo "Chmoding user files to 0644..."
for i in `/usr/local/vesta/bin/v-list-sys-users | awk '{if(NR>2)print}'`; do find /home/$i/web/ -name 'public_html' -type d -print0 | xargs -0 -I {} find '{}' -type f -print0 | xargs -0 -I {} chmod 0644 {}; done
echo "Done."
echo "Chmoding user folder to 0755..."
for i in `/usr/local/vesta/bin/v-list-sys-users | awk '{if(NR>2)print}'`; do find /home/$i/web/ -name 'public_html' -type d -print0 | xargs -0 -I {} find '{}' -type d -print0 | xargs -0 -I {} chmod 0755 {}; done
echo "Done."
echo "Fixing ownership of files..."
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/vesta/bin
SHELL=/bin/bash
MULTILINE=$(ls \
-1)
#Get latest WP-CLI
rm -rf /home/wp
wget --quiet https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /home/wp
<?php if(cs_get_option('map_type') != 'code'): ?>
<section class="<?php echo cs_get_option('dzsparallaxer') ? 'dzsparallaxer dzsparallaxer-map auto-init use-loading' : 'simple-map' ?>">
<div class="dzsparallaxer--target">
<div id="map"></div>
</div>
</section>
<script type=text/javascript>
<?php
# Disable Woocommerce cart fragments for homepage via .htaccess
# By creating empty response
# Please replace yoursite.com
# Disable only on homepage
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^https://yoursite.com/$ [NC]
RewriteCond %{QUERY_STRING} ^wc-ajax=get_refreshed_fragments$
RewriteRule ^(.*)$ $1 [R=204,L]
#!/bin/bash
# Converts all InnoDB tables in all databases to MyISAM
#DATABASES="db1 db2" # Convert databases db1 and db2 only
DATABASES="ALL" # Convert all databases
MYSQL_USER=root
@lukapaunovic
lukapaunovic / FIX.php
Last active October 11, 2018 13:15
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/user/public_html/app/lib/OneFileManager/Console.php:840
// I changed this
if ($ffprobe->streams($file)->videos()->first()->get("codec_name") != "h264" || $ffprobe->streams($file)->audios()->first()->get("codec_name") != "aac") {
// Vide is not MP4, should be converted
$save = true;
}
// To this
if ($ffprobe->streams($file)->videos()->first()->get("codec_name") != "h264") {
<?php
// Ukoliko je kategorija jednaka.... a NEMA biografija
if($_GET['kategorija']=="Biografije Poznatih Veštica" && !isset($_GET['biografija']))
{
include("Pocnimo/Clanci/Lista-BPV_Vesticarenje.php");
}
//Ukoliko je kategorija jednaka.... a IMA biografija