Skip to content

Instantly share code, notes, and snippets.

(function (history, trackingId, options) {
const getParameterByName = (paramName) => {
var searchString = window.location.search.substring(1),
i, val, params = searchString.split("&");
for (i=0;i<params.length;i++) {
val = params[i].split("=");
if (val[0] == paramName) {
return val[1] || undefined;
}
}
@dimobelov
dimobelov / wc_paypal.php
Created December 6, 2018 14:31
Allow BGN for WooCommerce and PayPal
// allow BGN for WooCommerce and PayPal
add_filter( 'woocommerce_paypal_supported_currencies', 'add_bgn_paypal_valid_currency' );
function add_bgn_paypal_valid_currency( $currencies ) {
array_push ( $currencies , 'BGN' );
return $currencies;
}
// Convert BGN to EUR for PayPal payments
add_filter('woocommerce_paypal_args', 'convert_bgn_to_eur');
@dimobelov
dimobelov / .htaccess
Created November 28, 2018 06:28 — forked from seoagentur-hamburg/.htaccess
UPDATE 2018: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2018
########################################################################
# ----------------------------------------------------------------------
# Rewrite from HTTP to HTTPS - if you want to use it, comment it out
# ----------------------------------------------------------------------
<!-- Pagination -->
<?php if (Paginator::numberOfPages()>1): ?>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<nav class="pagination" role="navigation">
<div class="row">
<div class="col-4 text-left">
<?php if (Paginator::showPrev()):?>
<a class="newer-posts btn" href="<?php echo Paginator::previousPageUrl() ?>">
@dimobelov
dimobelov / customscroll.css
Created September 23, 2018 10:54
Custom scrollbars
.customScrollBar::-webkit-scrollbar-button:horizontal:increment {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowRUZGQzk4NEE1Q0FFMDExOUI2OUQ1NEZFODhFQjY5MCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowQzU1NDExQUNFQTExMUUwODVCRDlGMjgxNTUwOTY0MSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowQzU1NDExOUNFQTExMUUwODVCRD
@dimobelov
dimobelov / web.config
Last active September 7, 2018 07:13
IIS Bludit configuration
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!--add/replace these lines in <system.webServer> section ...-->
<directoryBrowse enabled="false" />
<defaultDocument>
<files>
<clear />
<add value="index.php" />
<add value="index.htm" />
@dimobelov
dimobelov / specchars.php
Created August 20, 2018 18:36
Bludit special chars dictionary
private static $specialChars = array(
// Latin
'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'AE', 'Ç'=>'C',
'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I',
'Ð'=>'D', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ő'=>'O',
'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ű'=>'U', 'Ý'=>'Y', 'Þ'=>'TH',
'ß'=>'ss',
'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'ae', 'ç'=>'c',
'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i',
'ð'=>'d', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ő'=>'o',
@dimobelov
dimobelov / bluditsnipet.php
Last active August 4, 2018 12:58
Page Category
<?php if ($page->category()):?>
<div class="entry-terms-wrapper entry-categories-wrapper clear">
<span class="entry-terms category">
<a href="<?php echo DOMAIN_CATEGORIES.$page->categoryKey() ?>" rel="tag">
<?php echo $page->category() ?>
</a>
</span>
</div>
<?php endif?>
@dimobelov
dimobelov / wget
Created July 20, 2018 01:19 — forked from bueckl/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@dimobelov
dimobelov / pagination.php
Created July 16, 2018 19:47
New paginator for Bludit with move
<!-- Paginator -->
<?php if (Paginator::amountOfPages()>1):?>
<div id="paginator">
<ul class="pagination justify-content-center">
<?php
// Show previus page link
if(Paginator::showPrev()) {
echo '<li class="page-item"><a href="'.Paginator::prevPageUrl().'"><span class="page-link">'.$Language->g('Previous').'</span></a></li>';
} else {
echo '<li class="page-item disabled"><span class="page-link">'.$Language->g('Previous').'</span></li>';