Skip to content

Instantly share code, notes, and snippets.

View Mosquid's full-sized avatar

Dmitry Mosquid Mosquid

View GitHub Profile
@Mosquid
Mosquid / cherry-picker-adapter.js
Last active November 12, 2020 17:45
Cherry Picker Basic Adapter
const adapter = {
isProductPage: () => true, //checks if the page you are at is indeed a product page
getProductData: () => ({
price: 10,
title: 'Product title',
images: ['src'],
description: 'Full product description',
category: 'Product category name'
})
}
@Mosquid
Mosquid / events.js
Created June 26, 2018 19:37
Events
(function() {
var event = new Event('poop')
var clicked = 0
document.body.addEventListener('click', function() {
clicked++
if (clicked > 1) {
clicked = 0
document.body.dispatchEvent(event)
var node = false;
if(editor.selection) {
node = editor.selection.getNode();
// myPrism element ?
if (!isMyPrismCodeblock(node)){
node = false;
}
}
code = tinymce.html.Entities.encodeAllRaw(code.replace(/^\n+/gm,''));
@media( max-width: 860px ) {
.content-item {
> .rel {
padding: 15px 17px 12px;
background: rgba(#5e96ff, 0.1);
margin-bottom: 20px;
br {
display: none;