Skip to content

Instantly share code, notes, and snippets.

View owenversteeg's full-sized avatar

Owen Versteeg owenversteeg

View GitHub Profile
@owenversteeg
owenversteeg / googleDocsContribs.js
Last active January 3, 2016 01:59
Bookmarklet for collecting Google Docs contributor data into .tsv format. In order to use it, you must first expand the contributor list (and then run this in the console.) You can modify the call to console.log if you want the data to be alerted. (Of course, you can't copy the data unless it's console.logged.)
javascript:function getCollaboratorDetails() { var collaboratorsElements = document.getElementsByClassName('docs-revisions-tile-collaborator'); var collaborators = []; var returnText = "Name\tContributions\n";for (var i=0; i<collaboratorsElements.length; i++) { collaborators[collaboratorsElements[i].innerText] = (collaborators[collaboratorsElements[i].innerText]+1 || 1); } console.log(Object.keys(collaborators)); for (var i=0; i<Object.keys(collaborators).length; i++) { returnText += Object.keys(collaborators)[i] + "\t" + collaborators[Object.keys(collaborators)[i]] + "\n" } return returnText; } console.log(getCollaboratorDetails());
@postmodern
postmodern / comment.md
Last active January 11, 2024 15:37
Crypto Privacy Copy Pasta
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();