I hereby claim:
- I am jplhomer on github.
- I am jplhomer (https://keybase.io/jplhomer) on keybase.
- I have a public key ASC2sjVUdy9XeT2gcSjdtIkjHwyAYYqKI7YTfCDALshl7Ao
To claim this, I am signing this object:
| // Directive: x-clipboard | |
| Alpine.directive('clipboard', async (el, { expression }) => { | |
| el.addEventListener('click', async () => { | |
| await navigator.clipboard.writeText(expression); | |
| document.dispatchEvent( | |
| new CustomEvent('banner-message', { detail: { style: 'success', message: 'Copied to clipboard!' } }) | |
| ); | |
| }); | |
| }); |
| <?php | |
| // Your theme's functions.php file... | |
| function custom_tag_taxonomy( $slug ) { | |
| return 'YOUR_CUSTOM_SLUG'; | |
| } | |
| add_filter( 'tmt_tag_taxonomy', 'custom_tag_taxonomy', 10, 1 ); |
| $favorite-color: green; | |
| $pad: 1em; | |
| #app { | |
| background-color: $favorite-color; | |
| h1 { | |
| font-size: $pad * 5; | |
| } | |
| } |
| <?php | |
| // single.php or whatever template you'd like | |
| // 1. Get the ID of the current thumbnail for the post | |
| $attachment_id = get_post_thumbnail_id(); | |
| // 2. Get the tags associated to the image | |
| $tags = wp_get_post_terms($attachment_id, 'tmt_tag'); |
I hereby claim:
To claim this, I am signing this object:
| <!-- Our font file is fonts.css --> | |
| <script> | |
| /*! | |
| loadCSS: load a CSS file asynchronously. | |
| [c]2014 @scottjehl, Filament Group, Inc. | |
| Licensed MIT | |
| */ | |
| /* exported loadCSS */ |
| $ wp post list --format=ids | xargs wp post update --comment_status=closed | |
| # Output: | |
| # Success: Updated post 2514. | |
| # Success: Updated post 2511. | |
| # Success: Updated post 2504. | |
| # Success: Updated post 2499. | |
| # Success: Updated post 2441. | |
| # etc... |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| /* | |
| * This is a NodeJS app using the official MailChimp API wrapper. | |
| * I want to grab this data and display it in a custom view, but without a giant callback-y mess. Ideas? | |
| */ | |
| exports.view = function(req, res){ | |
| mc.campaigns.list({campaign_id: req.params.id}, function(campaignData) { | |
| var campaign = campaignData.data[0]; | |
| mc.reports.summary({cid:req.params.id}, function(reportData) { | |
| mc.lists.list({ list_id: campaignData.list_id }, function(listData) { |
| <?php if ( $events = get_field( 'events' ) ) : | |
| // Re-order our events just in case | |
| if ( get_field('sort_order') == 'Date Descending') { | |
| usort( $events, 'sort_by_date_descending'); | |
| } else { | |
| usort( $events, 'sort_by_date_ascending'); | |
| } | |
| // Set a year checker to see if we should print a new year | |
| $year = 0; |