Skip to content

Instantly share code, notes, and snippets.

View matt-e-king's full-sized avatar

Matthew King matt-e-king

View GitHub Profile
@matt-e-king
matt-e-king / gist:3ac2127025cf5dbc03001d9b21c1984a
Created April 17, 2024 19:06
Hypothesis Embed and sock in Vue app
// HypothesisEmbed.vue
// This is the component that mounts on the page that has the annotations
// It's important to destroy the client when componenent is unmounted
// because if the component remounts, it creates duplicate annotations in the DOM
<template>
<div
id="HypothesisEmbed"
class="HypothesisEmbed"
/>
@matt-e-king
matt-e-king / TidioChat.js
Last active August 2, 2018 21:36
A simple VueJS TidioChat component that creates the <script> tag and accepts an array of supported TidioChat events and $emits them back up to the parent
/**
* TidioChat.js
* A simple VueJS TidioChat component that creates the <script> tag and accepts an array of supported TidioChat events and $emits them back up to the parent
*
* vue-loader single file component example
*
* <template>
* <tidio-chat
* src="//code.tidio.co/<app key>.js"
* :visitor="visitorObject"
@matt-e-king
matt-e-king / .block
Created June 27, 2017 17:02
fresh block
license: mit
@matt-e-king
matt-e-king / gtmPlugin.js
Last active November 12, 2022 19:47
Vuex plugin for VueGtm (Google Tag Manager) (https://github.com/mib200/vue-gtm)
/**
Using the Vuex plugin pattern: https://vuex.vuejs.org/en/plugins.html,
this plugin will fire off a gtm.trackEvent for each mutation that occurs within your app.
It will also do a lookup on a literal object methods named after your mutation types. From those methods,
return a object with looks up on the store.
*/
import Vue from 'vue'
// import mutation-types, see example:
/**