This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| ************************************************************************************************************* | |
| ***** This will no longer lock up your browser tab, but it will not find a match for a very long time **** | |
| ***** Do not run this in a tab you do not want to reload **** | |
| ************************************************************************************************************* | |
| * | |
| * This was just me playing around trying to see if I could get a duplicate random string | |
| * when using the Math.random().toString(radix) method. | |
| * | |
| * I had planned to implement web workers with this as well so that I could let it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @fileOverview LocalStorageHelper RequireJS AMD Module File | |
| * | |
| * @author Russell Dempsey <[email protected]> | |
| * @version 1.0 | |
| */ | |
| define(function(require, module, exports) { | |
| 'use strict'; | |
| //includes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var keys = {}; | |
| $('#notes') | |
| .live('keydown', function(e){ | |
| keys[e.keyCode] = 'down'; | |
| console.log(keys); | |
| }) | |
| .live('keyup', function(e){ | |
| delete keys[e.keyCode]; | |
| console.log(keys); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Sample object that should work is: | |
| var exampleObj = { | |
| tag: 'div', | |
| attr: { | |
| id: '1234', | |
| href: 'some/url/path', | |
| class: ['createdElement', 'example', 'parent'], | |
| text: 'some text' | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Implementation of Vose's Alias Method | |
| * Pass in an array of probabilities such as [.1, .2, .4, .7], | |
| * probabilities do not have to add up to 1. | |
| * Returned will be the selected index based on the probabilities. | |
| * | |
| * show statistics with | |
| * aliasMethod(yourArray, true); | |
| * | |
| * use with |
NewerOlder