Skip to content

Instantly share code, notes, and snippets.

View srikat's full-sized avatar

Sridhar Katakam srikat

View GitHub Profile
@srikat
srikat / gist:6e841b58d9f75cb3e78f3d436183fe5d
Created October 19, 2026 10:15
Map F2 to Hyper (command+control+option+shift) + F system-wide using Karabiner Elements
{
"description": "F2 to Hyper (command+control+option+shift) + F",
"manipulators": [
{
"from": { "key_code": "f2" },
"to": [
{
"key_code": "f",
"modifiers": ["left_command", "left_control", "left_option", "left_shift"]
}
@srikat
srikat / gist:1f9c8f5e91b3a9bd403f76982a0bfaee
Created October 19, 2026 10:13
Karabiner Elements script to map F1 to Cmd+Shift+O in Brave Origin
{
"description": "Brave Origin: key remaps",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.brave\\.Browser\\.origin$"
],
"type": "frontmost_application_if"
@srikat
srikat / gist:064c507dc83b2dce680e02165069b605
Last active July 3, 2024 09:47
Alphabetical terms of a taxonomy
<?php
$taxonomy = 'category'; // set your taxonomy here
$terms = get_terms( $taxonomy, [
'hide_empty' => true,
'orderby' => 'name',
'order' => 'ASC',
] );
@srikat
srikat / gist:6144828b9d4572ecbf2a470290b596c5
Created October 18, 2023 05:38
Adding Posts in the Homepage and Posts page dropdowns at Settings > Reading in WP admin
add_filter( 'get_pages', function ( $pages, $r ) {
if ( function_exists( 'get_current_screen' ) && 'options-reading' === get_current_screen()->id ) {
$pages = array_merge( $pages, get_posts( ['post_type' => 'post'] ) );
}
return $pages;
}, 10, 2 );
@srikat
srikat / Stylefile.yml
Last active July 31, 2018 23:45
Customizations for www.elected.com.au via StyleURL.
---
version: 1.0
domains:
- www.elected.com.au
url_patterns:
- www.elected.com.au/*
timestamp: '2018-07-31T23:44:01Z'
id: BKFt
redirect_url: http://www.elected.com.au/oxygen/lets-talk/
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome
@srikat
srikat / test.html
Created May 8, 2018 06:48
Dummy Content for Gutenberg
<!-- wp:heading -->
<h2>Heading Block (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading -->
<h3>You are looking at one. (H3)</h3>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>Subhead Block</h2>
@srikat
srikat / keyboard-action-active-plugins.php
Last active March 15, 2018 08:05
Additional custom Actions for Keyboard Action to navigate to the list of active and inactive plugins
<?php
/**
* Plugin Name: Keyboard Action - Active Plugins
* Description: Additional custom Action for Keyboard Action to navigate to the list of active plugins
* Version: 0.1.0
* Author: Sridhar Katakam
* Author URI: https://sridharkatakam.com/
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<?php
/**
* Genesis Sample.
*
* This file adds functions to the Genesis Sample Theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0+
* @link http://www.studiopress.com/
@srikat
srikat / functions.php
Last active October 13, 2019 23:49
Remove "Select options" button from (variable) products on the main WooCommerce shop page. https://sridharkatakam.com/remove-select-options-button-variable-products-main-woocommerce-shop-page/
// Remove "Select options" button from (variable) products on the main WooCommerce shop page.
add_filter( 'woocommerce_loop_add_to_cart_link', function( $product ) {
global $product;
if ( is_shop() && 'variable' === $product->product_type ) {
return '';
} else {
sprintf( '<a href="%s" data-quantity="%s" class="%s" %s>%s</a>',
esc_url( $product->add_to_cart_url() ),
add_filter( 'genesis_seo_title', 'custom_header_inline_logo', 10, 3 );
/**
* Add an image inline in the site title element for the logo
*
* @param string $title Current markup of title.
* @param string $inside Markup inside the title.
* @param string $wrap Wrapping element for the title.
*
* @author @_AlphaBlossom
* @author @_neilgee