Skip to content

Instantly share code, notes, and snippets.

View mattduggan's full-sized avatar

Matt Duggan mattduggan

View GitHub Profile
@mattduggan
mattduggan / conversion.js
Last active November 14, 2018 14:25
Convert from legacy to perm thread id
// background.js
// memoize thread ids
const threadIds = {};
// register redirect handler to capture perm thread ids
function memoizePermThreadId(details) {
const originalUrl = new URL(details.url);
if (originalUrl.searchParams.has('idr')) {
var legacyThreadId = decodeURIComponent(originalUrl.searchParams.get('idr')).split('/')[1];
@mattduggan
mattduggan / activity-notifications.js
Last active April 25, 2018 15:27
Activity Notifications
const ACTIVITY_INTERACTION = "ACTIVITY_INTERACTION";
// defined action to change AITs
function createActivityInteraction(interactionTime) {
return { type: ACTIVITY_INTERACTION, payload: { interactionTime } };
}
// define initial state of AITs
const INITIAL_STATE = {
previousInteraction: localstorage.getItem("user@email.com.activity_interaction") || new Date(0).getTime(); // last time or epoch
- name: Node.js | Version
tags: dependencies
shell: node -v 2>&1 | sed s/v//
register: node_version
ignore_errors: True
- debug:
msg: "Node.js version: {{ node_version.stdout }}"
- name: Node.js | Download
@mattduggan
mattduggan / FeatureTourManager.js
Last active October 2, 2017 19:59
Feature Tours - "Tour Manager" Controller
(function() {
this.FeatureTourManager = function() {
var Actions = Yesware.get("FeatureTourActions");
var Store = Yesware.get("FeatureTourStore");
const states = {
DISMISSED: "dismissed",
FINISHED: "finished",
SHOW: "show",
SHOW_LATER: "show_later"
@mattduggan
mattduggan / FeatureTourStore.js
Last active October 2, 2017 19:02
Feature Tour - Store
(function() {
this.FeatureTourStore = function() {
var Constants = Yesware.get("FeatureTourConstants");
var Dispatcher = Yesware.get("EventDispatcher");
var NAMESPACE = "featureTourStore";
var state {
featureTours: [],
isLoading: false,
@mattduggan
mattduggan / FeatureTourConstants.js
Last active October 3, 2017 14:01
Feature Tour - Constants
(function() {
this.FeatureTourConstants = function() {
return {
events: {
GET_FEATURE_TOURS: "featureTours::getList::loading",
GET_FEATURE_TOURS_SUCCESS: "featureTours::getList::success",
GET_FEATURE_TOURS_ERROR: "featureTours::getList::error",
PUT_FEATURE_TOUR: "featureTours::put::loading",
PUT_FEATURE_TOUR_SUCCESS: "featureTours::put::success",
PUT_FEATURE_TOUR_ERROR: "featureTours::put::error"
@mattduggan
mattduggan / FeatureTourActions.js
Last active October 2, 2017 17:01
Feature Tour - Actions
(function() {
this.FeatureTourActions = function() {
var Constants = Yesware.get("FeatureTourConstants");
var Service = Yesware.get("FeatureTourService");
var Dispatcher = Yesware.get("EventDispatcher");
return {
getList: function() {
Dispatcher.trigger(Constants.GET_FEATURE_TOURS);
return Service
@mattduggan
mattduggan / FeatureTourService.js
Last active October 2, 2017 17:01
Feature Tour - Service API
(function() {
this.FeatureTourService = function() {
return {
getFeatureTours: function() {
return Yesware
.get("Request")
.request({
url: BASE + "api/v1/feature_tours/feature_tours",
type: "GET",
includeAuthToken: true
@mattduggan
mattduggan / featureTours.js
Last active September 26, 2017 17:54
Feature Tour API
"use strict";
//::base_url::
class ArgumentError extends Error {}
const states = {
DISMISSED: "dismissed",
FINISHED: "finished",
SHOW: "show",
@mattduggan
mattduggan / github-cheatsheet.md
Last active August 29, 2015 14:16
GitHub Cheatsheet

Tags

create
git tag v0.0.0
git push origin refs/tags/v0.0.0
delete
git tag -d v0.0.0