Skip to content

Instantly share code, notes, and snippets.

View ColinMichaels's full-sized avatar
🐢
I may be slow to respond. Or just slow in general.

Colin Michaels ColinMichaels

🐢
I may be slow to respond. Or just slow in general.
View GitHub Profile
@ColinMichaels
ColinMichaels / maps.js
Last active December 10, 2019 15:23
Google Maps Api - WP integration
jQuery.noConflict();
(function ($) {
if (jQuery('#locations-map')) {
if (window.addEventListener)
window.addEventListener('load', initMap(), false);
else if (window.attachEvent)
window.attachEvent('onload', initMap());
else
@ColinMichaels
ColinMichaels / AudioPlugin.js
Created October 27, 2019 00:55
VueJs Plugin using Howler to clean up and easily trigger a sound from anywhere. just by passing it the sound file path.
import {Howl} from 'howler';
let AudioPlugin = {
install: function (Vue, options = {}) {
AudioPlugin.events = new Vue();
Vue.prototype.$audio = {
play(src,params = {}){
this.load(src).play();
@ColinMichaels
ColinMichaels / calculator.blade.php
Last active October 15, 2019 15:09
Javascript Calculator (not original , but WIP)
<div class="calc-container">
<fieldset class="calculator">
<div class="display"></div>
<div class="keys">
<button class="btn-number btn">7</button>
<button class="btn-number btn">8</button>
<button class="btn-number btn">9</button>
<button class="btn-operator btn" data-action="divide">÷</button>
<button class="btn-number btn">4</button>
<button class="btn-number btn">5</button>
@ColinMichaels
ColinMichaels / seo-tags.js
Last active July 12, 2019 18:19
SEO Title and Alt Tags - jQuery
(function ($) {
function getFileName(path, type) {
var file = path.match(/[-_\w]+[.][\w]+$/i);
return (Array.isArray(file))? file[0] : type;
}
function jsUcfirst(string)
{
return string.charAt(0).toUpperCase() + string.slice(1);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="../css/jquery-ui-1.8.12.custom.css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">