Feb 16th 2010 × Download great new free fonts
A nice blog post that samples 35 great fonts free to download, some are actually rather good. Head to Instant Shift to check them out.
A nice blog post that samples 35 great fonts free to download, some are actually rather good. Head to Instant Shift to check them out.
Just found this enjoyable collection of javascript statements that don’t make any sense, such as:
"string" instanceof String; // false. [] == false; // true "" == false; // true null == false; // false, that's more like it typeof null // object null === Object // false
for these and more WTF moments in javascript, head over to wtfjs.com.
Long time without updates but I have been away since mid December. Long story short, went to Bulgaria with the best of intentions to ski a little and ended up “enjoying” the warmest winter this country has had in over 20 years instead. Meanwhile, folks back home in London reported to be freezing their privates in some serious sub-zero temperatures. Figures…
Anyway, things of consequence since my departure start with the advent of the mootools forge – finally a meaningful way to distribute plugins for the framework. I should see if any of my code snippets are worth releasing (can’t all be David Walsh, can it…)
Another notable addition to my bookmarks has been jsfiddle – it’s basically like Zalun’s mooshell but on steroids – adding support for all major frameworks you can fiddle with out there, most excellent and handy when refactoring between mootools and jquery and vice versa.
Finally, there has been a great compatibility layer for upgrading mootools 1.11 to 1.2.x – check out the official blog post here. I am now officially out of _technical_ excuses to do with upgradingand refactoring all the javascript at webtogs, so it’s going to be a manner of time after I get back.
The biggest joke of the year thus far has been the realisation that this little page (fragged.org) has now become the 2-nd listing on the google SERPs for ‘mootools blog’, trailing the official team blog only. Take that, David Walsh! Oh yeah, and a shiny new PR4 out of the blue, not a bad end to the year. With mootools 1.3 in the pipelines as well as mootools 2.0 – 2010 promises to be an quite exciting as well, looking forward to it.
P.S. Here’s another new ‘#mootools heavy blog’ just launched by a person I have come to respect a great deal over on the mootools mailing list check out Ryan Florence’s blog
This was supposed to be my Friday Fun post but it got to where it’s at on the following Monday instead. Having never tackled sprite animation before, this has been a learning experience anyway (on the principles of animation also).
I think the result is fairly adequate – a moving lemming in a world that changes atmospheric effects dependent on the time of day, complete with parallax-like effect relative as counter to the lemming’s movement.
Oh, yes. The lemming can also be quite moody–hates being bothered. Which is fine, you can blow him up too. Enjoy and click below:

P.S. This will feature as the header of fragged.org’s new wordpress theme which is almost completed now. So, a little taster of things to come…
P.P.S. Thanks to crisp for the original DHTML lemmings and to holy.pt for his vigorous testing and advice.
Just pulled out the old textSnow class foer 1.11 and rewrote it for 1.2.4. Anyway, head over to the demo page, it has all the info you need.
Whilst reading on XSS attacks today, I found this recently reported exploit in CubeCart 4 that can gain an attacker full administrative access to the store.
Not only that, it can help them dump your entire store DB – products, cats, users, orders, the works. Anyway, you get the idea. “CubeCart responded and informed their customers about this vulnerability” – as technical advisor for a site that runs on CC4, I can testify to the fact that the site owners were not informed of any such. Nice.
Here’s a novel idea (stolen from AppDen‘s Twitter feed fetch class) – extend the mootools-more’s JSONP class and setup some quick and easy geolocation lookups through pidgets.com and YQL (yahoo query language).
Here they are, 3 mini classes. First one uses the client’s IP address (or an optional ip supplied by options) to fetch geolocation info from http://geoip.pidgets.com/. The second instance fetches extended information on a place / city by location from Yahoo’s geoplaces DB, including things like local district, council authority, county and so forth, something that I find useful when creating quick signup forms for users and PAF lookups are not in the budget. The final class was simple test to fetch relevant timezone info of any latitude + longitude combination. It offers local time, offset from GMT or DST etc, but nothing that Date.get(“gmtoffset”) can’t accomplish anyway).
Request.geoLocation = new Class({
// gets basic info such as country and latitude data
Extends: Request.JSONP,
options: {
ip: $empty(), // default is user but you can lookup anything.
url: "http://geoip.pidgets.com/?format=json",
},
initialize: function(options) {
this.parent(options);
if (this.options.ip.length)
this.options.url = this.options.url += "&ip=" + this.options.ip
},
success: function(data, script) {
this.parent(data, script);
}
});
Request.getPlaceInfo = new Class({
// return json data with extended information of a place / location.
Extends: Request.JSONP,
options: {
url: "http://query.yahooapis.com/v1/public/yql?q=select * from geo.places where text='{location}'&format=json",
},
initialize: function(location, options) {
this.parent(options);
this.options.url = this.options.url.substitute({location: location});
},
success: function(data, script) {
this.parent(data, script);
}
});
Request.timeZone = new Class({
// return local timezone related date from geo coordinates
Extends: Request.JSONP,
options: {
url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Fws.geonames.org%2Ftimezone%3Flat%3D{latitude}%26lng%3D{longitude}'&format=json"
},
initialize: function(latitude, longitude, options){
this.parent(options);
this.options.url = this.options.url.substitute({latitude: latitude, longitude: longitude});
},
success: function(data, script) {
this.parent(data, script);
}
});
Here is a quick example of how it can be used on a form. Note you need mootools-more with JSONP for it to work.
Just a quick request – if you go and use snippets of javascript code from this site, great, it’s what it’s there for.
Just please, please, don’t copy and paste my google analytics javascript into your pages as well, it kind of messes up my stats. Thanks in advance.
It has always annoyed me as a user when having to strain my eyesight and having to type weird letters or numbers in order to prove I am a human. The practice is known as ‘captcha’ and dates back a while now. Regretfully, nothing much has changed aside from the ability of the bots to OCR better – we still need to read some obtuse characters.
This is why I wrote a javascript mootools captcha class called hOOmanTest – making the whole ‘prove you are not a bot’ a lot easier to stomach. Regretfully, it has no degradation as it relies on drag and drop, but you can use reCaptcha inside your target div as the fallback and have the class apply an .empty() before populating it, providing the upper layer.
*edit*: I really do hope it helps somebody, here is the first site that uses it out there–in a quotation webform on the cleaning 4u site, click the free quote banner to view.
This is not much of a post but a bit of a rant. “It’s my party and I’ll cry if I want to”, right?
I have a problem with jQuery–not with the framework as such, but with some of its users. And who in their right mind wouldn’t be getting the amp when just about any webdev site, forum and topic is now full of clever know-it-alls that come and declare how ‘such and such jQuery plugin will do what you want’. There’s always a jQuery plugin for everything, didn’t you know…
Does not matter if the question at hand is on vanilla javascript or mootools, just add jQuery and whistle… Already use another framework? Get jQuery anyway, it’s so good you can run in compatibility mode!
The sad part is in how a large portion of these jquerysts have absolutely no understanding of vanilla javascript. It feels as if some of them inadvertently consider ‘javascript’ and ‘jQuery’ to be synonymous…
Aren”t people just getting carried away slightly? I’ll be the first to admit how jQuery is full of awesome features, documentation and support. Why, it’s so great and so far removed from standard javascript syntax that some go to extreme lengths to mimic its shorthand in other frameworks as well. Just the other, having downvoted a jQuery solution for a mootools question on stackoverflow, I was told how $(“someid”).click(); was a perfectly reasonable and valid mootools syntax (as shown by David Walsh)
Paradoxically, in lowering the standards and requirements (in the sense of, by being too accessible and too easy to use), jQuery has spawned an army of coders that don’t even have to learn javascript. A lot of badly formed code gets released, complete with a disregard for best practices, memory, bandwith use, usability and god knows what else…
Still, perhaps there will come a day when mootools sports a high-spirited in-your-face following. For we have a lot to be tooting about, after all…