Example | Format |
---|---|
2021 | YYYY |
🦏 | 🦏 |
202108 | YYYYMM |
2021-08 | YYYY-MM |
🦏 | 🦏 |
8/5 | M/D |
08/05 | MM/DD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* ALLOW USER TO EDIT POST IF THEY ARE SELECTED AS THE PM | |
* Preferred way would be to use `user_has_cap` - see: | |
* - https://wordpress.stackexchange.com/a/360990/5380 | |
* - https://developer.wordpress.org/reference/hooks/user_has_cap/ | |
* However, WordPress has a nasty long standing issue with this line: | |
* - https://bit.ly/3I72jOn | |
* Where it forces a check to make sure the author is current user, which prevents any efforts to customize capabilities by using a `user_has_cap` filter. The bug is documented here: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"generator":"Code Snippets v3.3.0", | |
"date_created":"2023-04-08 21:52", | |
"snippets":[ | |
{ | |
"name":"Block Editor: Open Advanced Panel on Hover [SnipSnip.pro]", | |
"desc":"When using Gutenberg Block Editor, anytime your mouse enters the sidebar panel, if the \u201cAdvanced\u201d section is not open, then expand it. (Causes a minor annoyance where it scrolls to Advanced after expanding it.) (Includes a delay to ensure the sidebar is rendered... you might need to adjust the setTimeout delay if your site\/browser is slow to load the Block Editor.)\n\nCode revisions at: <a href=\"https:\/\/gist.github.com\/brandonjp\/bcfd56838359f12ef5c3ed2ecb6132dc\">https:\/\/gist.github.com\/brandonjp\/bcfd56838359f12ef5c3ed2ecb6132dc<\/a>\n\n<a href=\"https:\/\/snipsnip.pro\/s\/177\">https:\/\/snipsnip.pro\/s\/177<\/a>", | |
"tags":[ | |
"admin", | |
"gutenberg", |
I've had a huge problem with a variety of diacritics / accent marks in filenames. I lost a few files because I didn't notice that Dropbox had failed to sync umlauts and a few more rare characters between operating systems. So pulling from this list: http://pinyin.info/unicode/diacritics.html - I created a set of filename character replacements for dMC settings. This will replace any diacriticals with the closest unaccented latin character. It's been a game changer for me, posting it here in case it helps anyone else (and probably so I can find it again in a couple years). This is how I've changed it on macOS, I'm not sure about Windows.
- First, completely quit any dBpoweramp programs that are running.
- Then find the registry file at:
~/Library/dBpoweramp/XRegistry
and open it in a text editor. - Look for the key
"dMCFileNameChrReplace"
(If you have current replacements set, you might want to copy them to a blank text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
// ------------------------- | |
// Fetch Taxonomy Term & Meta | |
// ------------------------- | |
// GOAL: When a user selects a taxonomy term (from a MetaBox.io field) this helps fetch | |
// the term & it's metadata and returns JSON so the JS can load it into a Custom HTML block | |
// ------------------------- | |
// FORUM - https://metabox.io/support/topic/show-data-from-related-post-term-after-selection/ | |
// PHP - https://gist.github.com/21fed6266453de7ba76b3d2bc0e5a06f | |
// JS - https://gist.github.com/3b636d0c7e55ce6dc58ceba3de9a974e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------- | |
// Fetch Taxonomy Term & Meta | |
// ------------------------- | |
// GOAL: When a user selects a taxonomy term (from a MetaBox.io field) this fetches the | |
// term & it's metadata and loads it into a Custom HTML block | |
// ------------------------- | |
// FORUM - https://metabox.io/support/topic/show-data-from-related-post-term-after-selection/ | |
// PHP - https://gist.github.com/21fed6266453de7ba76b3d2bc0e5a06f | |
// JS - https://gist.github.com/3b636d0c7e55ce6dc58ceba3de9a974e | |
// ------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// when you're trying to use `position:sticky` on an element | |
// you'll have trouble if any parent/ancestor element has | |
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll) | |
// & turns out if a parent is `display:flex` it might need some love | |
// (to remedy this you can set the `align-self` of your sticky element) | |
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o | |
// so, to find those troublesome parents... | |
// copy & paste this into Chrome Inspector/Dev Tools console | |
// (and be sure to change the #stickyElement below, if needed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set qry to the query (argument one) | |
qry="$1" | |
# fix SNIP_DB location in case it contains tilde (won't expand in quotes) | |
SNIP_DB=$( echo $SNIP_DB | sed "s:^~:$HOME:" ) | |
# set the internal delimeter (idlm) to some char(s) that will never be used | |
idlm='' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.thisOrNothin = $.fn.thisOrNothing = function(search) { | |
// thisOrNothing(search) - gives back what you gave it, unless it's empty | |
// use the optional search to filter by selectors | |
// EX: $('div').thisOrNothing('.hidden') | |
// *Note: Don't you go chainin' this now... if it's NULL it'll blow | |
// First attempt to filter | |
var filtered = search ? this.filter(search) : this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find first matching prev sibling, parent, or parent prev sibling, within 3 levels up | |
$form.prevParentPrev('.form-title,.panel-title,.panel-heading,:header') | |
(function($) { | |
$.fn.prevParentPrev = function(search, optionalLimit) { | |
// prevParentPrev(search,optionalLimit) - similar to prevOrAunt() but also searches parents | |
// search for matches in priority: prev siblings, parent, parent prev siblings (repeat) | |
// with optional number limit for how far up the tree to search (or false to disable limit) | |
// * Modified from @Loren - http://stackoverflow.com/a/26237214/264601 |