This file contains 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
/* Based on https://github.com/appleple/react-modal-video/ */ | |
<template> | |
<div v-if="isOpen"> | |
<div | |
:class="classNames.modalVideo" | |
tabIndex='-1' | |
role='dialog' | |
:aria-label="aria.openMessage" | |
@click="$emit('update:isOpen', false)" |
This file contains 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
#!/usr/bin/env bash | |
# import an MS SQL .bak backup file to an MS SQL database, then export all | |
# tables to csv. run this script as `import.sh <filename>`. It expects to be | |
# run in the same directory as the backup file. | |
# this is only tested on my mac (OS X Catalina). I tried to stick to posix, but | |
# It will probably require some tweaking for you. I hope it gives a general | |
# sense of what you need to do at the very least. |
This file contains 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
/*! | |
* jQuery imagesLoaded plugin v2.0.1 | |
* http://github.com/desandro/imagesloaded | |
* | |
* MIT License. by Paul Irish et al. | |
*/ | |
(function(a,b){var c="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";a.fn.imagesLoaded=function(k){var h=this,m=a.isFunction(a.Deferred)?a.Deferred():0,l=a.isFunction(m.notify),e=h.find("img").add(h.filter("img")),f=[],j=[],g=[];function i(){var n=a(j),o=a(g);if(m){if(g.length){m.reject(e,n,o)}else{m.resolve(e)}}if(a.isFunction(k)){k.call(h,e,n,o) | |
}}function d(n,o){if(n.src===c||a.inArray(n,f)!==-1){return}f.push(n);if(o){g.push(n)}else{j.push(n)}a.data(n,"imagesLoaded",{isBroken:o,src:n.src});if(l){m.notifyWith(a(n),[o,e,a(j),a(g)])}if(e.length===f.length){setTimeout(i);e.unbind(".imagesLoaded")}}if(!e.length){i()}else{e.bind("load.imagesLoaded error.imagesLoaded",function(n){d(n.target,n.type==="error")}).each(function(n,p){var q=p.src;var o=a.data(p,"imagesLoaded");if(o&&o.src===q){d(p,o.isBroken);return}if(p.complete&&p.naturalWidth!==b){d(p,p.naturalWidt |
This file contains 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 mbn_get_stores_by_location( $zip, $radius ) { | |
global $wpdb; | |
$radius = intval( $radius ); | |
// we first need to get the source coordinates | |
$sql = "SELECT `latitude`, `longitude` FROM `wp_zip_codes` WHERE `zipcode` = '%s'"; | |
$coords = $wpdb->get_row( $wpdb->prepare( $sql, $zip ) ); | |
This file contains 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
import gql from 'graphql-tag' | |
import { print } from 'graphql/language/printer' | |
import richTextFragment from './contentModules/richText.gql' | |
import logoBlockFragment from './contentModules/logoBlock.gql' | |
import embedBlockFragment from './contentModules/embedBlock.gql' | |
import videoBlockFragment from './contentModules/videoBlock.gql' | |
import imageCollageFragment from './contentModules/imageCollage.gql' | |
import imageGridFragment from './contentModules/imageGrid.gql' | |
import slideshowBlockFragment from './contentModules/slideshowBlock.gql' | |
import singleImageFragment from './contentModules/singleImage.gql' |
This file contains 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
import Vue from 'vue' | |
import { debounce } from './utils/debounce'; | |
import { ProCatalogCategoriesQuery } from './queries/proCatalogCategories.gql'; | |
import { makeProCatalogResourcesQuery } from './queries/proCatalogResources'; | |
import Loading from './components/loading.vue'; | |
const GraphqlEndpoint = '/api' | |
const ResultsPerPage = 12; | |
const el = document.querySelector('#professional-catalog-app') |
This file contains 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 | |
use yii\base\Event; | |
use Craft; | |
use craft\elements\Entry; | |
Event::on( | |
Entry::class, | |
Entry::EVENT_AFTER_SAVE, | |
function(ModelEvent $event) { |
This file contains 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 /* This function attaches the image to the post in the database, add it to functions.php */ | |
function insert_attachment($file_handler,$post_id,$setthumb='false') { | |
// check to make sure its a successful upload | |
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false(); | |
require_once(ABSPATH . "wp-admin" . '/includes/image.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/file.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/media.php'); |
This file contains 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
// Hover.com "Zone file import/export" has been *Planned* since 2011 | |
// https://help.hover.com/entries/471066-Zone-file-import-export | |
// Here's a brittle approximation of export. | |
// | |
// 1. login to your account: https://www.hover.com/domains | |
// 2. run the following in your browser's JavaScript console, changing the first line | |
// to your domain | |
// 3. copy the text logged to the console. | |
// 4. manually correct FQDNs, these have to end with a period "." | |
// |
This file contains 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
/* $productCategoryID includes all subscription products */ | |
function cart_includes_subscription_category() { | |
$productCategoryID = 10; | |
global $woocommerce; | |
$product_in_cart = false; | |
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) : | |
$_product = $values['data']; | |
$terms = get_the_terms( $_product->id, 'product_cat' ); | |
if ( $terms ) : | |
foreach ($terms as $term) : |
NewerOlder