Skip to content

Instantly share code, notes, and snippets.

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

Karsten Gresch karstengresch

:octocat:
.
View GitHub Profile
@silaskoehler
silaskoehler / webpack.config.js
Last active May 21, 2024 18:21
Example webpack config override when using --experimental-modules flag with wp-scripts
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const { merge } = require( 'webpack-merge' );
// get default configs
const [ scriptConfig, moduleConfig ] = defaultConfig;
/**
* Override script config
* the script config is the default config, which is used with or without the --experimental-modules flag
@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';
@hosct
hosct / ctBiosKey.cpp
Last active October 12, 2024 15:55
ctBiosKey
#include <iostream>
#include <Windows.h>
int main()
{
DWORD firmwareTableProviderSignature = 0x41435049; // "ACPI"
DWORD firmwareTableMSDMID = 0x4d44534d; // "MSDM"
UINT structSize = EnumSystemFirmwareTables(firmwareTableProviderSignature, NULL, 0);
if (structSize == 0) {
@afragen
afragen / php.ini.hbs
Last active January 11, 2023 22:29
Stuff for xDebug 3.x and Local
; Add to all lightning services PHP conf files using xDebug 3.x
xdebug.mode=debug
xdebug.client_port=9003
xdebug.start_with_request=trigger
xdebug.discover_client_host=yes
xdebug.idekey=VSCODE
; Add to all lightning services PHP conf files using xDebug 2.x
xdebug.remote_enable=1
xdebug.remote_connect_back=Off
@b0gdanw
b0gdanw / DisableBigSur.sh
Last active October 31, 2024 09:54
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 and disabled.501.plist
# user
TODISABLE=()
@kevinslin
kevinslin / keybindings.json
Last active May 10, 2023 01:32
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
@wpmudev-sls
wpmudev-sls / forminator-skip-steps-in-pagination-form.php
Last active July 27, 2024 02:30
Forminator - Skip Steps in Pagination Form
<?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
*
@rbo
rbo / bassh_rc_snippet.sh
Last active September 23, 2022 19:26
powerline-go
# https://github.com/justjanne/powerline-go
if [ -x "$(command -v powerline-go)" ]; then
function _update_ps1() {
rc=$?
if [ -x "$(command -v powerline-go)" ]; then
PS1="$(powerline-go -error $rc -max-width 80 -newline -colorize-hostname -modules "ssh,host,user,cwd,perms,git,kube,exit" -priority "ssh,host,cwd,exit,git,kube" -modules-right "time" )"
else
PS1="\u@\h:\w $ "
fi
}
@jevakallio
jevakallio / readme.md
Last active November 1, 2024 00:01
`adb pull` from app data directory without root access

TL;DR;

com.package.name is your app identifier, and the file path is relative to the app user's home directory, e.g. '/data/user/0/com.package.name.

adb shell run-as com.package.name cp relative/path/file.ext /sdcard
adb pull /sdcard/file.ext

See long explanation below.

@rbo
rbo / Podman-on-MacOS.md
Last active September 1, 2021 13:42
Podman on Mac OS
$ export PATH=$(pwd):$PATH
$ podman-machine create box
Podman machine "box" already exists
$ podman-machine start box
Starting "box"...