Skip to content

Instantly share code, notes, and snippets.

View karstengresch's full-sized avatar
:octocat:
.

Karsten Gresch karstengresch

:octocat:
.
View GitHub Profile
@karstengresch
karstengresch / index.js
Created September 6, 2023 09:30 — forked from vralle/index.js
Use post meta in gutenberg
// https://make.wordpress.org/core/2020/03/02/general-block-editor-api-updates/
// https://github.com/WordPress/gutenberg/tree/trunk/packages/core-data
import {
PanelRow, TextControl,
} from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { useEntityProp } from '@wordpress/core-data';
import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
<?php
/**
* Plugin Name: [Forminator] Skip Steps in Pagination Form
* Plugin URI: https://premium.wpmudev.org
* Description: With this snippet and some extra configurations in your form is possible to skip steps according to user-selected choices in a control field - works with checkboxes, radio buttons and selects.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* Jira Task: FOR-428 and SLS-263 and SLS-2035
* License: GPLv2 or later
*
@karstengresch
karstengresch / Highlight CPT Archive and wp_nav_menu parents
Created May 23, 2023 17:15 — forked from VlooMan/Highlight CPT Archive and wp_nav_menu parents
Highlight the CPT (Custom Post Type) Archive & its Parents ("current-menu-parent") & its Ancestors ("current-menu-ancestor") in the WordPress Navigation wp_nav_menu() when viewing the Archive itself or a single detail page of the CPT. Let's say you have CPT called "projects" and you have a WordPress menu set as "My Work (link to a page) > Projec…
/**
* Gist Name: Highlight CPT Archive and wp_nav_menu parents
* Author: VlooMan
* Author URI: http://ishyoboy.com
*
* Highlight the CPT (Custom Post Type) Archive & its Parents ("current-menu-parent")
* & its Ancestors ("current-menu-ancestor") in the WordPress Navigation wp_nav_menu() when viewing the Archive itself
* or a single detail page of the CPT.
*
* Let's say you have CPT called "projects" and you have a WordPress menu set as
@karstengresch
karstengresch / keybindings.json
Created October 19, 2022 10:21 — forked from kevinslin/keybindings.json
Kevin's VSCode Keybindings
// Place your key bindings in this file to override the defaults
[
// The following are Kevin's keybindings for VSCode
// They are made available under CC BY 4.0
//
// To navigate
// `==` denote sections
// `---` denotes subsections
//
// == Dendron
@karstengresch
karstengresch / DisableBigSur.sh
Created May 30, 2022 06:45 — forked from b0gdanw/DisableBigSur.sh
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist & disabled.205.plist
# user
TODISABLE=()
@karstengresch
karstengresch / mkdim.py
Created August 20, 2021 13:02 — forked from esemwy/mkdim.py
Create DAZ Install Manager packages from zip or directory
#!/usr/bin/python
import uuid
import os
from zipfile import ZipFile, is_zipfile
import sys
import time
from random import randint
import argparse
import re
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: fluentd
labels:
app: fluentd
data:
fluentd.conf: |
@include prometheus.conf
@karstengresch
karstengresch / gist:d9e53751f717a46e972db0543f4c940f
Created August 17, 2020 14:31 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@karstengresch
karstengresch / ulimit.sh
Created February 14, 2020 11:28 — forked from Maarc/ulimit.sh
Bash script updating the ulimits
#!/usr/bin/env bash
# Automating https://blog.dekstroza.io/ulimit-shenanigans-on-osx-el-capitan/
echo "Updating the ulimits on OSX to be able to run RHAMT tests."
sudo bash -c 'cat >/Library/LaunchDaemons/limit.maxfiles.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
@karstengresch
karstengresch / WARNING.md
Created February 13, 2020 17:09 — forked from Ambroos/WARNING.md
Remove SentinelOne agent from Mac. Because honestly, it doesn't seem to do anything at all. Run as root, best is to do this from a recovery mode, single user mode with writeable filesystem, ...

USE AT OWN RISK

This was only tested on a partial SentinelOne installation on the High Sierra beta, where SentinelOne was never allowed to enable it's kernel extension.