This file contains 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 is a little experiment using getters to chain method calls. | |
First we have the example object | |
*/ | |
var someObject = { | |
someMethod:function(){console.log("someMethod called with",arguments); | |
return this; | |
}, | |
someValue:0, |
This file contains 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 is a Bookmarklet to make Wikipedia a bit more enjoyable. | |
1. save the one line of javascript as a bookmark | |
2. click it on any wikipedia page | |
3. all links will now load into the page on click | |
4. click the loaded paragraph again to load the next | |
5. after reading transforms back to a link, also all links that can't be loaded | |
6. you have to re-activate the bookmarklet if you navigate away or refresh the page | |
8. there are empty paragraphs sometimes |
This file contains 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
/* | |
assumes you put your constructors for vec2,vec3,etc on your prototype or in global scope | |
because the Function constructor will move the scope of the getters & setters to the global scope | |
if you don't care about a bunch of closures you could also just use normal functions. | |
*/ | |
["x","y","z"].map(function(ex,x,a){ | |
Object.defineProperty(vec3.prototype,a[x],{ | |
get:new Function("return this["+x+"];"), | |
set:new Function("v","this["+x+"] = v;") | |
}); |
This file contains 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
If you develop native applications you are at the mercy of established and restrictive stores, which are totally overcrowded and/or hard to get into. People generally don't like downloading things unless when it comes to pirating software, which they of course love. | |
If you develop on the web this problem doesn't really vanish. You still have to pay a lot of attention so the size of your application, you can't just develop software that has to download 5 gig data upfront before it starts running and pretend you develop a native application, like most engines that compile to the web asssume. | |
The problem is, most established tools are developed under the assumption that the size of your data doesn't really matter, and all data is already on the clients hard drive and relatively cheap to access. It has been optimized for developing applications to be distributed through upfront downloads or CDs/DVDs as a medium. But on the Web you're back to basically floppys that need to carry everything your App needs to *s |