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
| diff --git a/js/sketch.js b/js/sketch.js | |
| index 1f5c62f..7048e55 100644 | |
| --- a/js/sketch.js | |
| +++ b/js/sketch.js | |
| @@ -96,7 +96,7 @@ var __slice = Array.prototype.slice; | |
| return this.redraw(); | |
| }; | |
| Sketch.prototype.onEvent = function(e) { | |
| - if (e.originalEvent && e.originalEvent.targetTouches) { | |
| + if (e.originalEvent && e.originalEvent.targetTouches && e.originalEvent.targetTouches[0]) { |
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
| // License: MIT - https://opensource.org/licenses/MIT | |
| // Author: Michele Locati <michele@locati.it> | |
| // Source: https://gist.github.com/mlocati/7210513 | |
| function perc2color(perc) { | |
| var r, g, b = 0; | |
| if(perc < 50) { | |
| r = 255; | |
| g = Math.round(5.1 * perc); | |
| } | |
| else { |
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 obj = {a:1, 'b':'foo', c:[false,null, {d:{e:1.3e5}}]}; | |
| var str = JSON.stringify(obj, undefined, 2); // indentation level = 2 | |
| See the MDN Docs for further details (e.g. on the second argument); | |
| If you need syntax highlighting, you might use some regex magic like so: | |
| function syntaxHighlight(json) { | |
| if (typeof json != 'string') { | |
| json = JSON.stringify(json, undefined, 2); | |
| } |
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
| <?PHP | |
| // Generates a strong password of N length containing at least one lower case letter, | |
| // one uppercase letter, one digit, and one special character. The remaining characters | |
| // in the password are chosen at random from those four sets. | |
| // | |
| // The available characters in each set are user friendly - there are no ambiguous | |
| // characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
| // makes it much easier for users to manually type or speak their passwords. | |
| // | |
| // Note: the $add_dashes option will increase the length of the password by |