-
Notifications
You must be signed in to change notification settings - Fork 61
Wishlist
This is a list of useful things that should be implementable in 140 bytes. Help out and try your hand at one!
A function that turns a non-nested (fab)-style micro-DSL such as the following into a DOM, without using HTML.
domBuilder(
[/HTML/],
[/HEAD/],
[/TITLE/],
"Wouldn't this be cool?",
[],
[],
[/BODY/],
[/DIV/, {id: "container"}],
"Hello, world",
[],
[],
[]
)
domBuilder
(/HTML/)
(/HEAD/)
(/TITLE/)
("Wouldn't this be cool?")
()
()
(/BODY/)
(/DIV/, {id: "container"})
("Hello, world")
()
()
()
Encode: a function that takes the string input and map string ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
, return the base64 encoding. Bonus points for proper "=" padding. [UPDATE] Much progress has been made! The best place to see the latest wizardry is in this sla.ckers thread.
Decode: the reverse of the above.
The most annoying part about document.createElement, appendChild and friends is that they're not chainable! I suspect that a wrapper that returns "this" a la jquery could be very lightweight indeed.
My real-life use case is bookmarklets, fwiw.
Animated spinner in 138 bytes: https://gist.github.com/998900 - with a little CSS styling it looks like Apple's activity indicator.