Skip to content

Instantly share code, notes, and snippets.

openapi: 3.0.3
info:
title: Title
version: 0.51.0
servers:
- url: https://{host}/admin
variables:
host:
default: box.example.com
description: The API hostname.
add_filter( 'woocommerce_get_breadcrumb', 'custom_breadcrumb', 10, 2 );
function custom_breadcrumb( $crumbs, $object_class ){
// Loop through all $crumb
foreach( $crumbs as $key => $crumb ){
$taxonomy = 'product_cat'; // The product category taxonomy
// Check if it is a product category term
$term_array = term_exists( $crumb[0], $taxonomy );
@badsyntax
badsyntax / bug.yml
Created August 2, 2020 19:37
widdershins not generating basic auth headers
openapi: 3.0.3
info:
title: Example
version: 1.0.0
security:
- basicAuth: []
components:
securitySchemes:
basicAuth:
type: http
@badsyntax
badsyntax / generate.sh
Created May 10, 2020 13:46
Generate grpc-js typescript files
#!/usr/bin/env bash
OUT_DIR="./out"
TS_OUT_DIR="./src"
IN_DIR="./proto"
PROTOC="$(npm bin)/grpc_tools_node_protoc"
PROTOC_GEN_TS="$(npm bin)/protoc-gen-ts"
mkdir -p "$OUT_DIR"
diff --git a/test-fixtures/gradle-project/settings.gradle b/test-fixtures/gradle-project/settings.gradle
index 86c6978..b4996c5 100644
--- a/test-fixtures/gradle-project/settings.gradle
+++ b/test-fixtures/gradle-project/settings.gradle
@@ -7,4 +7,24 @@
* in the user manual at https://docs.gradle.org/6.3/userguide/multi_project_builds.html
*/
+pluginManagement {
+ repositories {
@badsyntax
badsyntax / decisions.md
Last active May 4, 2020 17:24
Decisions and approaches to integrating spotless (via gradle) into vscode.

Decisions

Decisions and approaches to integrating spotless (via gradle) into vscode.

What do I want from spotless, ideally?

I want a list of code changes that I can apply to the text document in vscode, without spotless saving the text file.

Why can't I use spotlessCheck?

@badsyntax
badsyntax / gradle-tasks-server.bat
Created April 5, 2020 20:11
gradle-tasks-server.bat
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem gradle-tasks-server startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@badsyntax
badsyntax / vscode-grpc.md
Last active November 16, 2023 23:17
The problem with using grpc in a vscode extension

Background

I'm using websockets & protobuf in my vscode extension. I want to replace the message abstractions & inconsistent code with a nicely defined server/client interface using grpc.

The Problem

After working on some POC code and running the extension for the first time, I was faced with the following error:

Activating extension 'richardwillis.vscode-gradle' failed: 
@badsyntax
badsyntax / gradle-tasks-server.sh
Created February 16, 2020 07:01
The gradle tasks server startup script, generated by CreateStartScripts
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
@badsyntax
badsyntax / cyrillic-script-variations.md
Last active January 23, 2020 09:28
Possible useful resources on understanding Cyrillic script variations (mostly to support Bulgarian)

Understanding Cyrillic script variations

Possible useful resources on understanding Cyrillic script variations (mostly to support Bulgarian).