Skip to content

Instantly share code, notes, and snippets.

View mikemccaughan's full-sized avatar

Mike McCaughan mikemccaughan

View GitHub Profile
@mikemccaughan
mikemccaughan / FauxStorage.js
Created June 10, 2020 16:03
An object with a Storage API like interface that is backed by a Map, for use in sandboxed iframes.
// A sham for the Storage API that uses an `Map` backer and does not survive refresh
// (since Stack Snippets don't survive refresh). Might help with basic questions about
// the Storage API regarding serialization, or getting/setting values.
//
// Note you'll need to use localStore instead of localStorage and sessionStore instead
// of sessionStorage to use the shams.
class FauxStorage {
// private class fields do not have wide support as of this writing
// #store = new Map();
@mikemccaughan
mikemccaughan / comments.md
Last active June 28, 2017 20:17
My list of Auto Comments for Stack Exchange sites

###[Q] More than one question asked It is preferred if you can post separate questions instead of combining your questions into one. That way, it helps the people answering your question and also others hunting for at least one of your questions. Thanks!

###[Q] Duplicate Closure This question will probably be closed as a duplicate soon. If the answers from the duplicates don't fully address your question please edit it to include why and flag this for re-opening. Thanks!

###[Q] Gimme teh codez Pure code-writing requests are off-topic on $SITENAME$ -- we expect questions here to relate to specific programming problems -- but we will happily help you write it yourself! Tell us what you've tried, and where you are stuck. This will also help us answer your question better.

###[Q] MCVE