Skip to content

Instantly share code, notes, and snippets.

@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 April 4, 2025 14:26
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",
@kallookoo
kallookoo / in_array.sh
Last active March 15, 2025 10:55
Shell function to check if an element exists in an array
# in_array - Check if an element exists in an array
# Usage: in_array "needle" "${array[@]}"
# Example: in_array "apple" "${fruits[@]}"
in_array() {
[ $# -gt 1 ] && [ "$(printf '%s\n' "$@" | grep -cx -- "$1")" -gt "1" ]
}