Skip to content

Instantly share code, notes, and snippets.

David Simpson dvdsmpsn

Block or report user

Report or block dvdsmpsn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dvdsmpsn on github.
  • I am dvdsmpsn ( on keybase.
  • I have a public key ASBUtoJ-78m3GmB_rjFlUmsY9IWMq-ALXtSERL4lpqQIHgo

To claim this, I am signing this object:

View gist:855ea95f91ae38808eb6bc6cd9fb2b51
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
View gist:5c98442e5af17b43858dc110ad424e0f
@class BroadcastChannel
A simple BroadcastChannel polyfill that works with all major browsers.
Please refer to the official MDN documentation of the Broadcast Channel API.
@see <a href="">Broadcast Channel API on MDN</a>
@author Alessandro Piana
@version 1.0.0
View Azure Active Directory OAuth error codes.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
Error Code,Description,Notes
"AADSTS50012","Invalid client secret is provided","You've used an incorrect OAuth secret. Check for typos, or go to Azure AD and generate a fresh one."
"AADSTS65004","The resource owner or authorization server denied the request","The user clicked on the *Cancel* button during the OAuth dance"
"AADSTS65005","The client application has requested access to resource ''. This request has failed because the client has not specified this resource in its requiredResourceAccess list.","Ensure that the Azure AD Application has the correct resource permissions"
"AADSTS50105","The signed in user '' is not assigned to a role for the application 'ab0a45c7-c085-4f3f-a868-62f3927926ef'# Trace ID: c8fc15e0-2d6f-49e8-b843-00a90032585f Correlation ID: 7e8e28f0-5a5d-4409-a217-1e8363fda666 Timestamp: 2015-08-27 13:23:38Z","The user is not authorized to access the app - source:
View AUI Tabs
## Macro name: aui-tabs-container
## Macro title: AUI Tabs Container
## Description: A container within which to group AUI Tabs
## Categories: Confluence content
## Macro has a body: Y
## Developed by: David Simpson <>
## Date created: 2016-10-19
## Installed by: Your Name
dvdsmpsn / encoded.js
Created Sep 26, 2016
Toggle Passwords Bookmarklet
View encoded.js
javascript:(function()%7B%0A%0A%09var F%2Cj%2Cf%2Ci%3B %0A%09F %3D document.forms%3B %0A%09for(j%3D0%3B j<F.length%3B %2B%2Bj) %7B %0A%09%09f %3D F%5Bj%5D%3B %0A%09%09for (i%3D0%3B i<f.length%3B %2B%2Bi) %7B %0A%09%09%09if (f%5Bi%5D.type.toLowerCase() %3D%3D "password") %7B%0A%09%09%09%09f%5Bi%5D.setAttribute("data-original-type"%2C"password")%3B%0A%09%09%09%09f%5Bi%5D.type %3D %27text%27%3B%0A%09%09%09%7Delse%7B%0A%09%09%09%09if (f%5Bi%5D.getAttribute("data-original-type") %3D%3D "password") %7B%0A%09%09%09%09%09f%5Bi%5D.type %3D %27password%27%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D %0A%09%7D %0A%7D)()%3B
dvdsmpsn /
Last active Sep 26, 2016
Google Analytics Setup for Atlassian Cloud Add-Ons

Google Analytics Setup for Atlassian Cloud Add-Ons

Add analytics.js to your add-on pages. Update the tracking code and Add-On / Macro Name and you should be good to go.

Custom Dimensions

You'll need to add some custom dimensions in Google Analytics. Use the names in comments in the section of analytics.js below // Add into custom dimensions

Personally Identifiable Information (PII)

Note that you must not store PII such as user_id which is sent over to Google Analytics in every request as a request parameter. Note userKey is not PII, so can be used.

You can’t perform that action at this time.