Skip to content

Instantly share code, notes, and snippets.

View KZeni's full-sized avatar

Kurt Zenisek KZeni

View GitHub Profile
@KZeni
KZeni / wpgmza_polygons.csv
Last active August 27, 2020 21:37
WP Google Maps Polygon Set Data for Individual US States (CSV Export to be used by CSV Import of Polygon Data [adjusting map id, link, etc. as needed]). Otherwise, see the polydata column for the shape data itself to be used by already-created polygon entries in WPGM (or newly-created; just means it wouldn't entail the bulk import tool.) https:/…
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
id,map_id,polydata,innerpolydata,linecolor,lineopacity,fillcolor,opacity,title,link,ohfillcolor,ohlinecolor,ohopacity,polyname
1,1,"(70.0187, -141.02049999999997),(70.1292, -141.72910000000002),(70.4515, -144.8163),(70.7471, -148.4583),(70.7923, -151.16089999999997),(71.147, -152.6221),(71.1185, -153.99540000000002),(71.4307, -154.88530000000003),(71.5232, -156.7529),(71.2796, -157.94489999999996),(71.2249, -159.6313),(70.6363, -161.8671),(70.0843, -163.58090000000004),(69.3028, -165.23990000000003),(69.1782, -166.8768),(68.3344, -168.0414),(67.6844, -165.9155),(67.2933, -164.6082),(66.7789, -164.0149),(66.581, -165.7507),(66.2867, -167.5745),(66.0269, -168.9862),(65.497, -168.94780000000003),(65.042, -167.4756),(64.3922, -167.01419999999996),(64.0554, -165.73429999999996),(64.0193, -163.2294),(63.9615, -162.11429999999996),(63.6877, -163.60289999999998),(63.453, -165.37170000000003),(62.4133, -166.37149999999997),(61.6534, -166.98670000000004),(60.8556, -166.4429),(60.5357, -167.8381),(59.5482, -167.71180000
<script>
// This listener is based on David Vallejo's HTML5 video listener, thyngster.com/tracking-html5-videos-gtm/
// Edited by Julius Fedorovicius, analyticsmania.com
// Let's wrap everything inside a function so variables are not defined as globals
(function() {
// This is gonna our percent buckets ( 10%-90% )
var divisor = 10;
// We're going to save our players status on this object.
var audios_status = {};
@KZeni
KZeni / modernizr.3.8.0.touchevents.js
Last active December 21, 2019 00:48
Extracted from Modernizr 3.8.0's touch events / touchevents support detection code.
var supportsTouch;
if (('ontouchstart' in window) || window.TouchEvent || window.DocumentTouch && document instanceof DocumentTouch) {
supportsTouch = true;
}
<?php
/* Pages Widget */
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'widgets_init', 'pagesinwidgets_pages' );
function pagesinwidgets_pages() {
register_widget( 'pagesinwidgets_page_section' );
}
window.wp = window.wp || {};
window.eml = window.eml || { l10n: {} };
( function( $, _ ) {
var media = wp.media,
l10n = media.view.l10n,
l10n_defaults = { media_orderby: 'date', media_order: 'DESC' },
mediaTrash = media.view.settings.mediaTrash,
// Customize the map's marker behavior on the homepage
function customizeHomepageMapMarkerBehavior(){
if($('body.home').length > 0 && typeof WPGMZA !== 'undefined'){
$(WPGMZA.maps).each(function(){
$(this.markers).each(function(){
// Clear out previous googleMarker listener events
google.maps.event.clearListeners(this.googleMarker, 'mouseover');
google.maps.event.clearListeners(this.googleMarker, 'click');
// Create our own marker event listeners (note: `this.googleMarker` is for the Google Maps Marker itself while `this` is the WPGM marker [includes title & other info])
google.maps.event.addListener(this.googleMarker, 'mouseover', function(event) {

Tools to choose from

The official SASS site has a list of possible options here: https://sass-lang.com/install

There are paid options, free options, and even open source options. These are then available on Windows, Mac, and/or Linux. They’re also inter-operable so it’s not a requirement that we use the same tool (though some consistency might be nice when it comes to sharing settings, discussing things, etc.)

I’ve personally used https://codekitapp.com (paid & Mac only; my current app of choice), and http://livereload.com (has paid options for helping further development & support, but it is provided 100% free per it being fully open source [Windows option is fully free even from the main download option]).

There’s then also http://koala-app.com (free & open source), https://prepros.io (paid), https://scout-app.io (free & open source), and others.

What’s nice is that you can really use the tool of your choice and it should play nice (I know Kaitlyn uses a different tool from me) since it’s still just

function disableWPGMPolygonLineOpacityOnInteraction(){
if(window.location.href.indexOf("communities") > -1 || window.location.href.indexOf("community") > -1){
$(WPGM_Path_Polygon).each(function(i){
if(this !== window){
google.maps.event.addListener(WPGM_Path_Polygon[i], "mouseover", function(event) {
this.setOptions({strokeOpacity: 0});
});
google.maps.event.addListener(WPGM_Path_Polygon[i], "click", function(event) {
this.setOptions({strokeOpacity: 0});
});
// Fancybox Lightbox
$('a[href*="youtu"]').each(function(){
if($(this).attr('href').indexOf('somna') !== -1 || $(this).attr('href').indexOf('band') !== -1 || $(this).attr('href').indexOf('/channel/') !== -1 || $(this).attr('href').indexOf('/user/') !== -1){
// Don't affect links to channel/user pages
}else{
$(this).attr('data-fancybox','video-gallery');
}
});
$('a[href*="vimeo"]').each(function(){
if($(this).attr('href').indexOf('somna') !== -1 || $(this).attr('href').indexOf('band') !== -1 || $(this).attr('href').indexOf('/channel/') !== -1 || $(this).attr('href').indexOf('/user/') !== -1){