This is now an actual repo:
| // Ported from Stefan Gustavson's java implementation | |
| // http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
| // Read Stefan's excellent paper for details on how this code works. | |
| // | |
| // Sean McCullough [email protected] | |
| /** | |
| * You can pass in a random number generator object if you like. | |
| * It is assumed to have a random() method. | |
| */ |
| if (!document.querySelectorAll) { | |
| document.querySelectorAll = function(selector) { | |
| var doc = document, | |
| head = doc.documentElement.firstChild, | |
| styleTag = doc.createElement('STYLE'); | |
| head.appendChild(styleTag); | |
| doc.__qsaels = []; | |
| styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}"; | |
| window.scrollBy(0, 0); |
| //addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
| (function(win, doc){ | |
| if(win.addEventListener)return; //No need to polyfill | |
| function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}} | |
| function addEvent(on, fn, self){ | |
| return (self = this).attachEvent('on' + on, function(e){ | |
| var e = e || win.event; | |
| e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
| e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |
You don't have to be a slave to OS X! Here's a guide to a sane dual-booting setup with Ubuntu 12.10 on your shiny MacBook Air. This is written and tested for a MacBook Air 5,2 (Mid 2012), but likely works the same with any modern Macbook.
Install according to instructions at this URL:
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secureflag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
| #delete all the remote tags with the pattern your looking for, ie. DEV- | |
| git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/% | |
| #delete all your local tags | |
| git tag | xargs -n 1 -i% git tag -d % | |
| #fetch the remote tags which still remain | |
| git fetch |
| function getTrilateration(position1, position2, position3) { | |
| var xa = position1.x; | |
| var ya = position1.y; | |
| var xb = position2.x; | |
| var yb = position2.y; | |
| var xc = position3.x; | |
| var yc = position3.y; | |
| var ra = position1.distance; | |
| var rb = position2.distance; | |
| var rc = position3.distance; |