Skip to content

Instantly share code, notes, and snippets.

@kallookoo
kallookoo / systemd-hgfs.sh
Last active October 15, 2024 18:10
Script to enabling HGFS Shared Folders using the systemd
#!/usr/bin/env bash
if [[ "$(id -u)" -ne "0" ]]; then
echo "This script must be run as root, please run this script again with the root user or sudo."
exit 1
fi
if [[ ! -f /etc/modules-load.d/open-vm-tools.conf ]] || ! grep -qE '^fuse' /etc/modules-load.d/open-vm-tools.conf; then
echo "fuse" | tee -a /etc/modules-load.d/open-vm-tools.conf
fi
@kallookoo
kallookoo / xman.sh
Created December 30, 2023 09:30
Open man page with x-man-page protocol
function xman() {
open "x-man-page:/$(printf '/%s' "$@")"
}
@kallookoo
kallookoo / solution-for-x-man-page.md
Last active December 26, 2023 14:57
Solution for x-man-page when using a command installed with brew that already exists in the OS

After trying the proposed [solution][1] and seeing that it still doesn't work.

The original code says to define MANPATH as explained in the man page, but when the man command reads the file, it append to MANPATH. So any command that exists in system man path (/usr/share/man, /usr/local/share/man) and was installed with brew, will show the man page inside of the system man path.

I started testing until I found a solution.

sudo mkdir -p /usr/local/etc/man.d
sudo tee /usr/local/etc/man.d/homebrew.man.conf <<'EOF' >/dev/null
manpath "/opt/homebrew/share/man:$manpath"
@kallookoo
kallookoo / clean-wc-action-database.sql
Created July 2, 2023 17:38
Clean the WooCommerce actions using SQL Commands.
DELETE FROM `wp_actionscheduler_actions` WHERE `status` IN ( 'canceled', 'failed', 'complete' );
TRUNCATE `wp_actionscheduler_logs`;
@kallookoo
kallookoo / php.json
Last active August 10, 2024 16:22
Visual Studio Code Snippets for WordPress
{
"WordPress: Prevent Direct Access to files": {
"prefix": "wp-secure-file",
"body": [
"defined( 'ABSPATH' ) || exit;",
"$0"
]
},
"WordPress: Plugin Headers": {
"prefix": "wp-plugin-headers",
@kallookoo
kallookoo / Tomorrow Night.terminal
Last active March 25, 2024 00:05
Tomorrow Night for Terminal.app
<!-- Tomorrow Night theme with Terminal options ( Window, Tabs, etc... ) -->
<?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>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO
U1JHQlxOU0NvbG9yU3BhY2VWJGNsYXNzRjAgMCAwABACgALSFBUWF1okY2xhc3NuYW1l
@kallookoo
kallookoo / ruleset.xml
Last active March 23, 2022 04:38
PHPCS exclude pattern directory and include subdirectory
<?xml version="1.0"?>
<ruleset name="WooCommerce-WordPress">
<description>Exclude pattern directory and include subdirectory</description>
<!-- Replace "parent-directory" with the directory to exclude. -->
<!-- Replace "include-directory" with the subdirectory to include. -->
<exclude-pattern>*/parent-directory/((?!include-directory)*)</exclude-pattern>
</ruleset>
@kallookoo
kallookoo / jet-engine-example-hook-with-query-args.php
Created November 1, 2021 17:01
jet engine - example hook for redirect with query args
add_filter(
'jet-engine-booking/filter/hook_name',
function ( $result, $data, $form, $notifications ) {
if ( $result ) {
$data = array_filter( $data );
$page = home_url();
wp_redirect( add_query_arg( $data, $page ) );
exit;
}
},
@kallookoo
kallookoo / obtener-responsive-slider-gallery.php
Created August 11, 2021 06:27
Obtener las imagenes de responsive slider gallery
@kallookoo
kallookoo / tomorrow-night-scheme-for-windows-terminal.json
Last active January 30, 2023 20:42
Tomorrow Night scheme for Windows Terminal
{
"name": "Tomorrow Night",
"black": "#000000",
"red": "#cc6666",
"green": "#b5bd68",
"yellow": "#f0c674",
"blue": "#81a2be",
"purple": "#b294bb",
"cyan": "#8abeb7",
"white": "#ffffff",