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
window.fetch = new Proxy(window.fetch, { | |
apply(actualFetch, that, args) { | |
const result = Reflect.apply(actualFetch, that, args); | |
result.then((response) => { | |
console.log("fetch completed!", args, response); | |
}); | |
return result; | |
} | |
}); |
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
if(location.hash) { | |
window.scrollTo(0, 0); | |
} | |
const scrollToElement = (element) => { | |
const elementRect = element.getBoundingClientRect(); | |
let elementTop = elementRect.top + window.scrollY; | |
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
{% assign cart_com_total_price = 0 %} | |
{% for line_item in cart.items %} | |
{% if line_item.product.compare_at_price %} | |
{% assign com_price = line_item.product.compare_at_price | times: line_item.quantity %} | |
{% assign cart_com_total_price = cart_com_total_price | plus: com_price %} | |
{% else %} | |
{% assign cart_com_total_price = cart_com_total_price | plus: line_item.final_price %} | |
{% endif %} | |
{% endfor %} |
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
const mobilePlaceholders = () => { | |
document.querySelectorAll('[data-mobile-placeholder]')?.forEach(el => { | |
if(window.innerWidth <= 1100){ | |
el.setAttribute('placeholder', el.dataset.mobilePlaceholder); | |
}else{ | |
el.removeAttribute('placeholder'); | |
} | |
}); | |
} |
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
const {src, dest, watch, series} = require('gulp'); | |
const sass = require('gulp-sass')(require('sass')); | |
const prefix = require('gulp-autoprefixer'); | |
const minify = require('gulp-clean-css'); | |
const terser = require('gulp-terser'); | |
const rename = require('gulp-rename'); | |
const concat = require('gulp-concat'); | |
function compilerSass () | |
{ |
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 | |
function _wpml_posts_sql_query($post_type = 'post', $post_status = 'publish', $language_code = ICL_LANGUAGE_CODE) | |
{ | |
global $wpdb; | |
$post_type = "post_$post_type"; | |
$query = "SELECT COUNT( {$wpdb->prefix}posts.ID ) | |
FROM {$wpdb->prefix}posts | |
LEFT JOIN {$wpdb->prefix}icl_translations ON {$wpdb->prefix}posts.ID = {$wpdb->prefix}icl_translations.element_id |
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
mutation fileCreate($files: [FileCreateInput!]!) { | |
fileCreate(files: $files) { | |
files { | |
alt | |
createdAt | |
fileErrors{ | |
code | |
details | |
message | |
} |
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 | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Arr; | |
class VerifyProxy | |
{ | |
public function handle(Request $request, Closure $next) |
NewerOlder