Skip to content

Instantly share code, notes, and snippets.

View jffry's full-sized avatar
💭
<script>alert('👋')</script>

Jeffrey Stanton jffry

💭
<script>alert('👋')</script>
  • <script>alert("company");</script>
  • <script>navigator.geolocation.getCurrentPosition(alert);</script>
View GitHub Profile
@jffry
jffry / orderedSelectionsWithReplacement.js
Created July 28, 2015 18:43
JS: Ordered Selections With Replacement
function orderedSelectionsWithReplacement(numChoices, subsetSize)
{
var subsets = [], i, advance, picks = new Array(subsetSize).fill(null), pos = 0;
while (true)
{
//try to find something that has yet to be used
advance = false;
for (i = picks[pos]||0; i < numChoices; i++)
{
picks[pos] = i;