Skip to content

Instantly share code, notes, and snippets.

View Myster's full-sized avatar

Murray Roke Myster

View GitHub Profile
@diegojancic
diegojancic / TokenGenerator.cs
Created November 3, 2017 14:56
Random string generator, based on
/*
Based on Eric J's answer here: https://stackoverflow.com/a/1344255/72350
- Fixed bias by using 64 characters
- Removed unneeded 'new char[62]' and 'new byte[1]'
- Using GetBytes instead of GetNonZeroBytes
*/
using System.Security.Cryptography;
using System.Text;
@Myster
Myster / data-attribute-revealer
Created September 6, 2012 02:56
Bookmarklet to reveal data attributes (assumes jQuery)
alert('D.A.R. moved here: https://github.com/Myster/DataAttributeRevealer/')
@addyosmani
addyosmani / backboneglobalpubsub.md
Created February 4, 2012 19:37
Backbone.js global pub/sub

Generally one implements notifications by listening for events on specific models but if one wishes to have a single global message interchange, it could be done as follows:

var pubsub = new Backbone.Model;

View1 = Backbone.View.extend({
  initialize: function(){
    pubsub.bind('custom event', callback);
  }
 // ...