Skip to content

Instantly share code, notes, and snippets.

View MisterMike's full-sized avatar

Nibiru MisterMike

View GitHub Profile
@piotrpog
piotrpog / product.twig
Last active June 15, 2022 19:01
Commerce product page with sprig. Old version, doesnt work with Craft 4.
{% extends 'shop/_layouts/main' %}
{% block main %}
{{ sprig('product_content', {productId: product.id}) }}
{{ sprig.script }}
{% endblock %}
// helpers.js
const loadSingleEntryPoint = ({
// Elements selectors
els = [],
// Execute something before the actual load of the module
beforeLoad = (el) => {},
// Perform module load & return a Promise
@RobyRew
RobyRew / spotifyhosts
Last active January 15, 2023 08:54
Spotify Methods to Block Ads
Official SubReddit: https://www.reddit.com/r/Spotifyhosts/
FOLLOW DOWN
| |
| |
\ | / \ | /
\|/ \|/
@MohamedLamineAllal
MohamedLamineAllal / dropzonejsBoiler.js
Created November 21, 2018 11:04
Dropezonejs complete example (thumbnail preloading, sending a form a long, or form alone, going arround add to dropzone quirk)
var lastLogoUrl = '{{route('storage.companies.logo', ['file' => basename($cmpny->logo)])}}';
{{-- var isLogoUpdated = false; --}}
var updatedData = null;
var oldData = null;
var form = null;
var dataToSend = null;
@ostark
ostark / EventCatcher.php
Created September 27, 2018 16:56
A wildcard event handler that logs all Yii/Craft events
class EventCatcher
{
/**
* @var array
*/
protected $classConstants = [];
public function __invoke(yii\base\Event $event)
{
@shaneturner
shaneturner / craft-cms-entries-by-category-group.twig
Created December 4, 2017 00:26
Craft CMS: Getting entries grouped by category in order of the category type drag & drop order.
{# Get the categories related to my "entrySection" entries in structure order #}
{% set entries = craft.entries.section('entrySection') %}
{% set relatedCats = craft.categories.relatedTo(entries) %}
{# Loop the categories #}
{% for category in relatedCats %}
{{ category.title }}
{# Get and loop through entries related to this cat #}
@goodjob1114
goodjob1114 / howToModifyOvaFile.md
Last active January 27, 2024 10:49
how to modify .ova file on linux/Mac using terminal....export vm (OVF 1.0) from virtualbox, then modify some tag and hash value for import vm to ESXi

extract ova files from an archive

$ tar -xvf vmName.ova

modify ovf for some invalid tag

$ vi vmName.ovf
// Get the template HTML and remove it from the doument.
var previewNode = document.querySelector("#template");
previewNode.id = "";
var previewTemplate = previewNode.parentNode.innerHTML;
previewNode.parentNode.removeChild(previewNode);
var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone
url: "/target-url", // Set the url
thumbnailWidth: 80,
thumbnailHeight: 80,
@joyrexus
joyrexus / README.md
Last active August 20, 2024 12:46 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})