Eric's public fiddles
-
Insurance quote calculator
Use a lookup table until a certain value, then use a formula
-
Stylish console message
Open the console to see a colorful message with gradients and shadows. FF, Chrome, Safari only
-
Spiral Grid Walker
Input a tile or "step" number, return an X-Y coordinate where that tile will be. Source: http://stackoverflow.com/a/19287522/1938889
-
Highlight word under cursor - v2
This is an algorithmic solution using node traversal that accurately captures the full and correct word under a cursor in a text node.
-
Highlight word under cursor - v1
One solution is to strip out the span tags inside paragraphs but preserve their text. Split words and phrases are thus joined back together as regular text. Each word is found by whitespace division (not just a space), and those words are wrapped in spans which can be individually accessed.
-
JS FileReader MIME type sniffer
You can easily determine the file MIME type with JavaScript's FileReader before uploading it to a server. See my Stackoverflow writeup here: http://stackoverflow.com/a/29672957/1938889
-
XMLHttpRequest.open() hook
XMLHttpRequest.open() hook method