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
$(document).on('click', 'a[href^="#"].js-ancor', function (event){ | |
event.preventDefault(); | |
var id=$(this).attr('href'); | |
$('html, body').animate({ | |
scrollTop: $(id).offset().top-$('header').innerHeight()-20 | |
}, 1000); | |
}); |
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
// ajax add to cart | |
function generic_ajax_add_to_cart() { | |
global $woocommerce; | |
$params=$_POST['params']; | |
// die(json_encode( $params )); | |
$prid = $params['prodid']; | |
$qty = $params['quant']; | |
// $var = $params['variation']; |
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 generic_ajax_posts(){ | |
$params=$_POST | |
$offset=$params['params']['p']*((!empty($params['params']['q'])) ? $params['params']['q'] : 4); | |
$post_type=$params['params']['pt']; | |
$catid=(!empty($params['params']['cat']))?$params['params']['cat']:null; | |
$tpl=(!empty($params['params']['tpl']))?$params['params']['tpl']:null; | |
$args=array( | |
'post_type'=>$post_type, | |
'posts_per_page'=>4, | |
'offset'=>$offset |
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
rm /etc/hosts | |
wget http://winhelp2002.mvps.org/hosts.txt -q -O ->> /opt/etc/hosts | |
wget http://hosts-file.net/ad_servers.txt -q -O ->> /opt/etc/hosts | |
wget "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" -q -O ->> /opt/etc/hosts | |
sed -i 's/127.0.0.1/0.0.0.0/g' /opt/etc/hosts | |
ln -s /opt/etc/hosts /etc/hosts | |
killall dnsmasq | |
dnsmasq |
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
// working with get params | |
function getSearchParameters() { | |
var prmstr = window.location.search.substr(1); | |
return prmstr != null && prmstr != "" ? transformToAssocArray(prmstr) : {}; | |
} | |
function transformToAssocArray( prmstr ) { | |
var params = {}; | |
var prmarr = prmstr.split("&"); | |
for ( var i = 0; i < prmarr.length; i++) { |
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
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://it-legal.pro/$1 [R,L] | |
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
<script> | |
// this one might go anywhere in your code | |
// inline it to get best results | |
loadscripts=function(arr){ | |
!function(e,t,r){function n(){for(;d[0]&&"loaded"==d[0][f];)c=d.shift(),c[o]=!i.parentNode.insertBefore(c,i)}for(var s,a,c,d=[],i=e.scripts[0],o="onreadystatechange",f="readyState";s=r.shift();)a=e.createElement(t),"async"in i?(a.async=!1,e.head.appendChild(a)):i[f]?(d.push(a),a[o]=n):e.write("<"+t+' src="'+s+'" defer></'+t+">"),a.src=s}(document,"script",arr) | |
}; | |
// loader end | |
// this one is for attaching event to your play button and load scripts | |
$(document).on('click', '.js-wistia-placeholder .playbtn', function(event){ | |
var cont=$(this).parent(); |
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
#!/bin/bash | |
# http://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#easy-way-ubuntu-16-04 | |
#Задаем пароль для пользователя root для MySQL | |
COOKIES_PASSWORD="PASSWORD" | |
#Задаем часовой пояс для PHP | |
TIMEZONE="Asia/Irkutsk" | |
# Настраививаем автоматический ввод пароля для админа mysql. |
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
#!/bin/bash | |
# Service watchdog script | |
# Put in crontab to automatially restart services (and optionally email you) if they die for some reason. | |
# Note: You need to run this as root otherwise you won't be able to restart services. | |
# | |
# Example crontab usage: | |
# | |
# Strict check for apache2 service every 5 minutes, pipe results to /dev/null | |
# */5 * * * * sh /root/watchdog.sh apache2 "" > /dev/null | |
# |
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
<!-- | |
Email template: student/purchase_notification | |
Description: This email is sent to a student when they enroll in a course. | |
--> | |
<!-- Email Title --> | |
<div class="header-title"> | |
<h1>{{text.email_receipts.thank_you_for_enrolling_in }} {{sale.course.name }}</h1> | |
</div> |
OlderNewer