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 | |
//add +1 (USA country code) for international callers, only allow digits through | |
$tel_link = 'tel:+1' . preg_replace('/\D/', '', $intro_phone_number); | |
//for UI output replace all kinds of dashes with non-breaking dash | |
$intro_phone_number_text = preg_replace('/[-–—]/', '‑', $intro_phone_number); |
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
ffmpeg -i source-video.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis destination-video.webm |
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
let allElements = document.querySelectorAll("body *"); | |
let allElementsArray = Array.prototype.slice.call(allElements); | |
let widerThan = allElementsArray.filter(function(element) { | |
let elWidth = element.clientWidth; | |
return elWidth > window.innerWidth; | |
}); | |
let offRight = allElementsArray.filter(function(element) { | |
let boundingBox = element.getBoundingClientRect(); |
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 | |
$context['posts'] = new Timber\PostQuery([ | |
'posts_per_page' => -1, | |
'post_type' => 'locations', | |
'post_status' => 'publish', | |
'order' => 'ASC', | |
]); | |
//map out the ACF data per post | |
$locations_data = array_map(function($location){ |
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 | |
function rk_save_zip_to_wp_uploads($path, $file_name){ | |
//handles file db entry for zip visibility in Media Library | |
$wordpress_upload_dir = wp_upload_dir(); | |
$path_to_file = $wordpress_upload_dir['basedir'] . '/' . $file_name; | |
$mime_type = mime_content_type($path); | |
if(file_exists($path_to_file)){ | |
$attachment_url = get_option('siteurl') . '/wp-content/uploads/' . $file_name; |
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 | |
$zip_file = 'package.zip'; | |
// Get real path for our folder | |
// Initialize archive object | |
$zip = new ZipArchive(); |
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
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); |
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
let HoverTransfer = (({}) => { | |
class HoverTransfer { | |
constructor(node, options = {}) { | |
this.node = node; | |
this.targetSelector = `[data-hover-id="${this.node.dataset.hoverTarget}"]`; | |
this.target = document.querySelector(this.targetSelector); | |
this.activeClass = 'js-is-hovered'; | |
} | |
toggleHover(){ |
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
SELECT * FROM `wp_postmeta` WHERE meta_key IN ('_wp_attached_file', '_wp_attachment_backup_sizes', '_wp_attachment_metadata', '_thumbnail_id') |
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
<iframe src="https://calendar.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23ffffff&ctz=America%2FNew_York&src=OXU4anFwM2hsdDZwZTY3NWdpZTZsZjFkOW9AZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&color=%2322AA99&mode=AGENDA" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe> |