Skip to content

Instantly share code, notes, and snippets.

View Attaulla9's full-sized avatar
💻
Focusing

Attaullla Faniband Attaulla9

💻
Focusing
View GitHub Profile
@Attaulla9
Attaulla9 / eventTracker.js
Created December 4, 2019 13:50 — forked from walkergv/eventTracker.js
Unbounce Event Tracker Script
<script type='text/javascript'>
(function() {
var EventTracker, lpScriptVersion;
lpScriptVersion = "1.2.0";
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
@Attaulla9
Attaulla9 / jQueryCheatSheet.js
Created September 13, 2020 17:07 — forked from davidmigloz/jQueryCheatSheet.js
Basic jQuery Cheat Sheet.
http://www.w3schools.com/js
http://www.w3schools.com/jquery/
http://api.jquery.com/
http://www.html5canvastutorials.com/
--> events:
$('#submit').click(function);
$("p").dblclick(function);
$("#id").change(function);
$(canvas).mousedown(function);
@Attaulla9
Attaulla9 / vanilla-js-cheatsheet.md
Created September 13, 2020 17:24 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@Attaulla9
Attaulla9 / gist:44cdbf8a6ac43864eef716a67471b400
Created April 20, 2021 05:34 — forked from thegdshop/gist:3197540
WooCommerce - Add category body class in single product view
<?php
// add taxoonomy term to body_class
function woo_custom_taxonomy_in_body_class( $classes ){
if( is_singular( 'product' ) )
{
$custom_terms = get_the_terms(0, 'product_cat');
if ($custom_terms) {
foreach ($custom_terms as $custom_term) {
$classes[] = 'product_cat_' . $custom_term->slug;
@Attaulla9
Attaulla9 / less-fields-virtual.php
Created April 28, 2021 18:03 — forked from neilgee/less-fields-virtual.php
WooCommerce Remove Address Fields from checkout based on presence of virtual products in cart
<?php
add_filter( 'woocommerce_checkout_fields' , 'virtual_products_less_fields' );
/**
* WooCommerce Remove Address Fields from checkout based on presence of virtual products in cart
* @link https://www.skyverge.com/blog/checking-woocommerce-cart-contains-product-category/
* @link https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
* @link https://businessbloomer.com/woocommerce-hide-checkout-billing-fields-if-virtual-product-cart/
*/
@Attaulla9
Attaulla9 / scripts-ahoy.php
Created April 29, 2021 06:55 — forked from neilgee/scripts-ahoy.php
SwiperJS and ACF Image Gallery Thumbnail Carousel
<?php // <~ don't add me in
add_action( 'wp_enqueue_scripts', 'ls_scripts_styles', 20 );
/**
* SwiperJS Scripts
*/
function ls_scripts_styles() {
wp_enqueue_style( 'swipercssbundle', get_stylesheet_directory_uri() . '/css/swiper-bundle.min.css' , array(), '6.4.11', 'all' );
wp_enqueue_script( 'swiperjsbundle', get_stylesheet_directory_uri() . '/js/swiper-bundle.min.js', array(), '6.4.11', true );
wp_enqueue_script( 'swiperinit', get_stylesheet_directory_uri() . '/js/swiper-bundle-init.js', array( 'swiperjsbundle' ), '1.0.0', true );
@Attaulla9
Attaulla9 / simple-json-reponse.php
Created April 30, 2021 00:45 — forked from james2doyle/simple-json-reponse.php
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($code = 200, $message = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@Attaulla9
Attaulla9 / conversionClick.html
Created June 23, 2021 11:22 — forked from johnnyopao/conversionClick.html
This works to trigger a Unbounce Conversion for buttons that do not navigate away but instead keep them on the same page
<script>
window.trackConversion = function() {
$('body').append('<iframe src="clkg/http/unbouncepages.com/blankpage/" style="display: none"></iframe>');
};
lp.jQuery(function($) {
$('#lp-pom-button-11').click(function () {
trackConversion();
});
@Attaulla9
Attaulla9 / scrollandstickmin.html
Created June 23, 2021 11:25 — forked from johnnyopao/scrollandstickmin.html
Scroll and Stick Fixed Header Min
<script>
//Scroll and Stick Fixed header v1.0
//Replace ID below with your box ID
var boxToFix = '#lp-pom-box-587';
function showOrHideHeader(){var o=$(window).scrollTop();o>topPositionOfBox?($(boxToFix).css({position:"fixed",top:"0px"}),$(boxClone).css({position:"fixed",top:"0px"})):($(boxToFix).css({position:"absolute",top:topPositionOfBox}),$(boxClone).css({position:"absolute",top:boxTop}))}var boxParent=$(boxToFix).parent(),boxClone=$(boxToFix).clone().attr("id",boxToFix+"-bg"),topPositionOfBox=$(boxToFix).position().top,boxHeight=$(boxToFix).css("height"),boxTop=$(boxToFix).css("top"),boxBorderWidthTop=$(boxToFix).css("border-top-width"),boxBorderWidthBottom=$(boxToFix).css("border-bottom-width"),boxBorderWidthLeft=$(boxToFix).css("border-left-width"),boxBorderWidthRight=$(boxToFix).css("border-right-width"),boxBorderStyleTop=$(boxToFix).css("border-top-style"),boxBorderStyleBottom=$(boxToFix).css("border-bottom-style"),boxBorderStyleLeft=$(boxToFix).css("border-left-style"),boxBorderStyl
@Attaulla9
Attaulla9 / unbounce.md
Created June 29, 2021 08:59 — forked from Micka33/unbounce.md
unbounce validator messages

#Code à mettre:

(function(e){function t(){var t=window.module.lp.form.data;var n=t.validationMessages;var r=t.validationRules;this.changeTitle=function(n){e(function(){e("#"+t.errorContainerId).find("div.error").text(n)})};this.changeField=function(e,t,i){if(!n[e])return;n[e].required=t;if(i&&r[e].email)n[e].email=i;if(i&&r[e].phone)n[e].phone=i}}window.errors=new t(lp.jQuery)})(lp.jQuery)
$(function() {
 setTimeout(function(){

   lp.jQuery.validator.addMethod("phone", function(phone_number, element)
   {
    phone_number = phone_number.replace(/\s+/g, "");