This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| ; A REPL-based, annotated Seesaw tutorial | |
| ; Please visit https://github.com/daveray/seesaw for more info | |
| ; | |
| ; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
| ; Seesaw's basic features and philosophy, but only scratches the surface | |
| ; of what's available. It only assumes knowledge of Clojure. No Swing or | |
| ; Java experience is needed. | |
| ; | |
| ; This material was first presented in a talk at @CraftsmanGuild in | |
| ; Ann Arbor, MI. |
| function mergeDeep (o1, o2) { | |
| var tempNewObj = o1; | |
| //if o1 is an object - {} | |
| if (o1.length === undefined && typeof o1 !== "number") { | |
| $.each(o2, function(key, value) { | |
| if (o1[key] === undefined) { | |
| tempNewObj[key] = value; | |
| } else { | |
| tempNewObj[key] = mergeDeep(o1[key], o2[key]); |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer