Skip to content

Instantly share code, notes, and snippets.

View jplhomer's full-sized avatar

Josh Larson jplhomer

View GitHub Profile
@jplhomer
jplhomer / app.scss
Last active February 13, 2017 17:31
Using Laravel Mix for a standalone project
$favorite-color: green;
$pad: 1em;
#app {
background-color: $favorite-color;
h1 {
font-size: $pad * 5;
}
}
@jplhomer
jplhomer / functions.php
Created March 19, 2017 21:19
Set a custom taxonomy for Taghound Media Tagger
<?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 );
// 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!' } })
);
});
});