Skip to content

Instantly share code, notes, and snippets.

@al3x
al3x / gist:967060
Created May 11, 2011 18:49 — forked from 3n/gist:967051
A "blog" "post" about asynchronous script loading and MooTools.

A lot of talk at JSConf was on the use of modules: AMD, CommmonJS, or otherwise. Since the server-side JavaScript world has this mostly covered, a more heavily discussed topic was bringing the joys of modularity to the client-side. This, of course, is a tricky thing to do since loading scripts requires some sort of relatively slow and possibly asynchronous network request. How does one balance the issues of perceived latency, JS execution (UI blocking), page weight, and code tidiness? I spent some time looking into this and here's my first stab at a solution (no I'm not releasing some open source project shut up).

Real quick: if you don't agree that splitting files to do asynchronous loading is a good idea you should read more.

I code most of my projects in MooTools (including my current project, BankSimple, so modularity is a given for me. MooTools is

@al3x
al3x / euler 52
Created October 27, 2008 19:49 — forked from anonymous/euler 52
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
URL: http://projecteuler.net/index.php?section=problems&id=52
Problem summary goes here:
It can be seen that the number, 125874, and its double, 251748, contain
exactly the same digits, but in a different order.
@al3x
al3x / gist:17018
Created October 15, 2008 21:40 — forked from mzsanford/gist:17017
Jetty from Scala
import java.util.logging.Logger
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import org.mortbay.jetty.Server
import org.mortbay.jetty.handler.AbstractHandler
object Test extends AbstractHandler {
val log = Logger.getLogger("handler")
def main(args : Array[String]) = {