Skip to content

Instantly share code, notes, and snippets.

@onwp
onwp / Exclude groups
Created November 17, 2021 16:36 — forked from lukecav/Exclude groups
Groups to exclude in Redis object caching for LearnDash
comment
counts
plugins
learndash_reports
learndash_admin_profile
wc_session_id
Regarding why the write operation was of poor throughput it would depend on the amount of data that would be inserted by the operation along with any deadlocks or wait events waiting for a lock it may need to take hold off as well. To that end if possible you could run those write operations to check for any deadlocks(by checking the output of the show engine innodb status) they may be causing , further you can also run profile on them to see what stage of the execution is slowing down the whole query. The explain plan will also provide us with insights on the query execution plan allowing you to make changes to improve efficiency.
https://dev.mysql.com/doc/refman/5.7/en/show-profile.html
https://dev.mysql.com/doc/refman/5.7/en/show-engine.html
https://dev.mysql.com/doc/refman/5.7/en/explain.html
>>Do we have to look at using managed Aurora cluster with read replicas, connection pooling for better throughput?
It is indeed an alternative that you can consider, your workload contains both read and writ
<?php
add_filter('acf/pre_load_reference', 'hwk_bypass_get_field_ref', 10, 3);
function hwk_bypass_get_field_ref($return, $field_name, $post_id){
if(is_int($post_id))
$return = acf_get_field($field_name, $post_id);
return $return;
}
@onwp
onwp / list-of-curl-flags.txt
Last active December 30, 2022 13:17 — forked from eneko/list-of-curl-options.txt
List of curl flags
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@onwp
onwp / pre-commit
Created August 15, 2024 13:22 — forked from joorloohuis/pre-commit
Git pre-commit hook for syntax checking before committing
#!/bin/bash
#
# PHP Syntax linter, checks syntax before commit actually happens
# Save this file in your git project as .git/hooks/pre-commit and make sure it's executable
# PHP lint command, modify if necessary
LINT='/usr/bin/php -l'
files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.php$")
if [ "$files" = "" ]; then