Skip to content

Instantly share code, notes, and snippets.

View kylejmhudson's full-sized avatar
🐢
I may be slow to respond.

Kyle Hudson kylejmhudson

🐢
I may be slow to respond.
View GitHub Profile
@kylejmhudson
kylejmhudson / showOnUnread.js
Created August 2, 2018 12:10
Zendesk Chat Widget: Open minimized chat window on new message
/*
Show the chat window if the number of unread messages > 0 and the chat window is not currently displayed.
see references:
setOnUnreadMsgs - https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#setOnUnreadMsgs
getDisplay - https://api.zopim.com/files/meshim/widget/controllers/liveChatAPI/Window-js.html#$zopim.livechat.window.getDisplay
show - https://api.zopim.com/files/meshim/widget/controllers/liveChatAPI/Window-js.html#$zopim.livechat.window.show
*/
$zopim(function() {
$zopim.livechat.setOnUnreadMsgs(function(numUnread){
if(numUnread > 0 && !$zopim.livechat.window.getDisplay()) {
@kylejmhudson
kylejmhudson / serverless.yml
Created January 22, 2020 14:20 — forked from DavidWells/serverless.yml
Creating a custom serverless resource for subscribing to SNS topics in another region
# Welcome to Serverless!
#
# Happy Coding!
service: cross-region-sns-subscriber
# Keep environment specific configurations in separate files
custom: ${file(config/${env:STAGE}.json)}
provider: