Skip to content

Instantly share code, notes, and snippets.

@onwp
onwp / gist:1894f28876aeb1b9d9aab155ad5f6a65
Created September 27, 2021 20:56
'geckodriver' executable needs to be in PATH fix
wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
sudo sh -c 'tar -x geckodriver -zf geckodriver-v0.23.0-linux64.tar.gz -O > /usr/bin/geckodriver'
sudo chmod +x /usr/bin/geckodriver
rm geckodriver-v0.23.0-linux64.tar.gz
@onwp
onwp / github-commit-emoji-message.md
Created November 3, 2021 23:40
Github commit emoji message
Commit type Emoji
Initial commit 🎉 :tada:
Readme 👀 :eyes:
Add or update a .gitignore file 🙈 :see_no_evil:
Add or update snapshots 📸 :camera_flash:
Folder .github :octocat: :octocat:
Version tag 🔖 :bookmark:
New feature :sparkles:
Introduce breaking changes 💥 :boom:
@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
Alternatively, you can install it using any of the following:
docker run -it --rm -p 8888:8888 ghcr.io/validator/validator:latest
npm install vnu-jar
brew install vnu
pip install html5validator
See https://validator.github.io/validator/ for more details.
If you have docker installed, docker option is the easiest.
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
git rev-list --objects --all | grep -f <(git verify-pack -v .git/objects/pack/*.idx| sort -k 3 -n | cut -f 1 -d " " | tail -10)
<?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 / find_unused_scss_variables.sh
Created January 9, 2023 13:36
Bash script to find unused SCSS variables
#!/usr/bin/env bash
# HOW TO USE
# Save code to file
# Run as "SCRIPT_FILE_NAME SASS_DIRECTORY"
# e.g "./find_unused_scss_variables.sh ./sass"
VAR_NAME_CHARS='A-Za-z0-9_-'
find "$1" -type f -name "*.scss" -exec grep -o "\$[$VAR_NAME_CHARS]*" {} ';' | sort | uniq -u