Skip to content

Instantly share code, notes, and snippets.

@psalz
psalz / clang_tidy_stats.py
Created July 27, 2022 12:53
Print number of unique occurences of clang tidy diagnostics in a given log file
#!/usr/bin/env python3
import sys
import re
from typing import Dict, Set
clang_tidy_log = sys.argv[1]
# A clang-tidy diagnostic is of the form:
# <path>:<line>:<column>: <warning|error>: <message> [<diagnostic-name(s)>]
@psalz
psalz / detect_single_choice_attributes.js
Created April 5, 2016 20:00
Woocommerce Composite Products: Detect single choice attributes
"use strict";
(function ($) {
/**
* Detects all component attributes that have only a single value option and adds the '.single-choice' class
* to the respective table row. Additionally, a <span> with the class '.single-choice-label' is added, containing
* the options name.
*
* If executed twice, the previous changes are reverted first (in order to account for possible scenario changes).
* Default values or previous selections are saved and restored if the option becomes available again.