View swiper-play-in-viewport.js
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
// TESTIMONIALS SWIPER | |
const testimonySwiper = new Swiper(".testimonySwiper", { | |
loop: true, | |
slidesPerView: 1.3, | |
spaceBetween: 16, | |
centeredSlides: true, | |
initialSlide: 3, | |
autoplay: { | |
delay: 7500, | |
disableOnInteraction: true, |
View Sticky-element-debugging.js
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
let parent = document.querySelector('.sticky').parentElement; | |
while (parent) { | |
const hasOverflow = getComputedStyle(parent).overflow; | |
if (hasOverflow !== 'visible') { | |
console.log(hasOverflow, parent); | |
} | |
parent = parent.parentElement; | |
} |
View wordpress-alt-tag-programmatically.php
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
<?php | |
/******************************************************** | |
** IMAGE ALT, GLOBAL FIX | |
** run trough all existing images, grab the image title | |
** which is built using the filename automaticlly and | |
** asign it to the alt - at-least it wont be empty! | |
********************************************************/ | |
add_action('after_setup_theme', 'image_alt_fix'); | |
function image_alt_fix() { | |
$args = array( |
View insert-israel-cities.php
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
<?php | |
/******************************************************** | |
** INSERT CITIES WITH REGION | |
** insert to taxonomy named cities | |
********************************************************/ | |
function insertCities() { | |
$cities = array( | |
array("ירושלים","ירושלים"), | |
array("תל אביב-יפו","תל אביב"), |
View cf7-floating-labels-example-form.html
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
<div class="newsletterSignUpFooter"> | |
<div class="form-group">[text* your-name class:form-control class:input-lg] <label for="your-name">First Name</label></div> | |
<div class="form-group">[text* text-777 class:form-control class:input-lg] <label for="your-name">Last Name</label></div> | |
<div class="form-group">[email* your-email class:form-control class:input-lg] <label for="your-name">Your Email</label></div> | |
<div class="">[submit class:btn class:btn-warning class:btn-lg class:w100 "Send"]</div> | |
</div> |
View Example - Mixing it togther
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
include('../functions/browser-agent.php'); | |
include('../functions/strings.php'); | |
include('../functions/curl-helper.php'); | |
// ADD BROWSER EMULATION TO FILE GET CONTENT | |
$useragent = get_random_useragent(); | |
// SCRAPE THE DESIRED PAGE | |
$clnUrl2Chk = normalize_url($urltocheck); |
View Simple Curl Example
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 curl_download($url, $referer, $browserAgent){ | |
if (!function_exists('curl_init')){die('Sorry cURL is not installed!');} | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); // Set URL to download | |
curl_setopt($ch, CURLOPT_REFERER, $referer); // Set a referer | |
curl_setopt($ch, CURLOPT_USERAGENT, $browserAgent); // User agent | |
curl_setopt($ch, CURLOPT_HEADER, 1); // include header? | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // print out the data? | |
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Timeout in seconds |
View Clean url - return base 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
/******************************************* | |
** FUNCTION TO GET BASE URL | |
*******************************************/ | |
function normalize_url($url) { | |
$parts = parse_url($url); | |
$countParts = count(split('[.]', $parts['host'])); | |
if (substr($parts['host'], 0, 4) == 'www.') { | |
$base_url = str_replace('www.', '', $parts['host']); | |
} |
View Get random browser agent
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
/******************************************* | |
** GET RANDOM USER AGENT | |
*******************************************/ | |
function get_random_useragent() { | |
$agents = array( | |
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36', | |
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36', | |
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5', | |
'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36', |
View gist:71ce885240ecece1311b
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
* {-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;} | |
body {background: url(images/bg-01.png) repeat 0 0;} | |
#login {width: 60%; max-width: 720px;} | |
#loginform {background: #121212;} | |
.message {text-align:center; background: #121212 !important; color:#fff; border: 0 !important;text-transform: uppercase;} | |
.login #login_error {border-top: none;background: #121212;-webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);color: #DD3D36;text-align: center;font-size: 20px;font-weight: bold;text-transform: uppercase;text-shadow: 1px 1px 1px #000;} | |
body.login div#login h1 {height: 194px;} | |
body.login div#login h1 a {background: url(images/custom-login-logo.jpg) no-repeat 0 0; height: 200px; width: 768px; display: block !important; margin: 0 auto;} |
NewerOlder