First off, I'm a fan of jQuery. It is a great library. My problem is I want to use more of it! I want a Rails/Django/Pylons/Your Framework Here for writing Javascript apps. The problem is that while jQuery provides a very powerful plugin architecture, it doesn't offer a set of conventions and helpers to make writing a Javascript app with jQuery consistent. I find that every time I step up to the Javascript plate with jQuery, my path is usually sporadic and rarely do I cover the same ground in term of application design, while many of the same requirements exist. With that in mind, what I'd like to have is a jQuery framework that does the following.
Regarding the different function types, it is unclear the best way to organize a plugin. Looking at the jQuery UI code, there are some obvious patterns, but they are difficult to follow within the scope of creating your own plugin. There seems to be a lot of ramp up code involved that hides the basic patterns. As I mentioned above, it would be nice to have a set of function type helpers to reduce the boilerplate as well as simplify things. One good example is that most jQuery plugins work with a selector and without a selector. It would be nice to have an easy way of defining a functions that have either functionality or both. Likewise, having an obvious place for a simple library function seems helpful as well.
One thing I'm not looking for is another MVC pattern. I don't think it makes much sense as the DOM and jQuery's data features provide more than enough model enough, in addition to effectively defining the view in one way or another. What I'm thinking about be more like a stack of functions and hooks that you plug into. These would effectively just be namespaces that have assumptions. Something like:
$.plugin = {
dispatch : 'action',
actions : { 'show' : function () { ...}, 'hide' : function () { ... } },
libs : { ... }
config : {...}
ui : { ... }
}
Now, I have no idea how that "ui" thing would work or what the "action" dispatcher is, but hopefully it is somewhat clear what the idea is. While jQuery rules, it is not obvious how to use all the amazing bits. There is still a lot of voodoo that happens in the Javascript world and having a Javascript specific set of constraints to keep things in order might be very helpful in pushing the limits that much farther. I'm not talking about things like Cappuccino that provide an entire GUI framework either. This is just a set of design patterns and helpers to make the basics a little more obvious so those folks who don't program in Javascript every day (ie most web developers) have a better chance of doing something really interesting. If constraints set you free, then that means Javascript, with its crazy features and style, is a prison.
I'll probably take a stab at the above idea, but if you're intersted in sending along code, I'd love to see it. Likewise, if you do the work, I'm happy to sit by and cheer you on. Is this a decent idea?
It has become a frustrating pattern. I walk out my front door only to see some marketing material stuffed in the screen door or thrown on the lawn. This seems to happen almost every day and I'm sick of it. It is a waste of paper and my time. If I spent 2 minutes a day dealing with the trash, that is about an hour a month and half a day a year. This doesn't seem like much, but when you consider that some business is paying for a miniscule percentage of callbacks, the city having to recycle or deal with the trash and the folks walking around stuffing my door, it becomes clear that the cost to society seems far from negligable.
My point is that it is my home and I should be able to say what goes in terms of littering. If a kid drops a candy wrapper on the driveway, that kid is doing something wrong. I don't see the difference in an adult taking a larger piece of trash and attaching it to my screen door as much different.
I suppose I could put up a sign saying anyone found littering advertising materials on this property will be fined, but I doubt collecting would be manageable. It wouldn't suprise me if a advertising invoice came across some businesses desk they would pay it without really even looking. The problem is that doesn't get me any closer to stopping the massive amount of flyers and coupons dealt to my walkway. Spam sucks, but at least you don't have to dig in the shrubs to get it out, only to drop it off in the recycling, that is assuming it hasn't been rained on.
At work there were some changes to the VPN server that seemingly made my ability to connect something of a problem. It turned out to be an issue with my home router, but in the process I went ahead and tried working on Linux instead of OSX. At work other folks are pretty happy with tiling window managers such as Ion3 and AwesomeWM, so I gave some a try. It has been a while since using Linux on the desktop, but it was a surprisingly nice experience. Since then, I went ahead and have gotten my ubuntu partition up to snuff and have been using it full time.
The window manager I settled on is called StumpWM. It is written by the same guy who did Ratpoison with the major difference being that Lisp is used instead of C. You are able to manage windows in the same way you manage frames in Emacs, so it feels pretty comfortable to an Emacs user. While it was easy to get started using StumpWM, there were still things that needed to be setup. Specifically, getting my VPN to stable place was something of a blocker.
I found that in Gnome, things worked pretty well. NetworkManager made the VPN setup a cinch (although I did figure out how to get things working with pon/poff). I wanted to effectively have Gnome for setting up all the niceties such as a tray and NetworkManager. My first step was to try StumpWM with Gnome. This was pretty easy by setting an environment variable in a .gnomerc file.
export WINDOW_MANAGER=/usr/bin/stumpwm
The problem with this was that the panel and nautilus desktop were both frames in StumpWM. It just didn't feel right. What I did eventually was find trayer, a system tray replacement that only has a tray. It is really simple and it made running nm-applet really easy. There is a really cool screencast showing off StumpWM that showed starting the gnome panel and it working directly with StumpWM, but it didn't work for me. Likewise, there were a bunch of example configuration files that I tried to pull from that didn't work. Eventually it became clear I was using an old version of StumpWM. When I upgraded, things were much nicer. The documentation magically became correct and I could script things as needed in my StumpWM config. I setup my two monitors and things have been smooth sailing. Here is my StumpWM for reference if anyone is interested:
[code]
;; -*-lisp-*-
(in-package stumpwm)
(run-shell-command "python ~/xstart.py")
(define-key *root-map* (kbd "C-.") "gnext")
(define-key *root-map* (kbd "C-,") "gprev")
(defcommand firefox () ()
"Start/Switchto Firefox."
(run-or-raise "firefox" '(:class "Firefox")))
(define-key *root-map* (kbd "f") "firefox")
(run-shell-command "/usr/bin/trayer --edge bottom --SetDockType false --transparent true --expand false --align center &")
(run-shell-command "/usr/bin/gnome-settings-daemon &")
;;(run-shell-command "/usr/bin/gnome-panel &")
(run-shell-command "/usr/bin/nm-applet &")
(run-shell-command "/usr/bin/bluetooth-applet &")
(run-shell-command "/usr/bin/pactl load-module module-x11-xsmp &")
(set-prefix-key (kbd "C-i"))
;; create groups
(run-commands
"gnewbg System"
"gnewbg Web")
;; (run-commands "exec gnome-settings-daemon")
(setf *window-border-style* :thin)
;; Turn on the modeline
(if (not (head-mode-line (current-head)))
(toggle-mode-line (current-screen) (current-head)))
;; Show the time in the modeline
(setf *screen-mode-line-format*
(list '(:eval (run-shell-command "date '+%R, %F %a'|tr -d [:cntrl:]" t)) " | [^B%n^b] %W"))
(setf *mouse-focus-policy* :sloppy) ;; :click, :ignore, :sloppy
[code]
Most of the startup commands that are run I took from the gnome session editor where they are listed. The python "xstart.py" script just uses xrandr to setup my second monitor if it is connected. I could see that being an issue if I ever give a presentation, but honestly I'd probably just end up using something like Gnome or OSX if it were really that big a problem.
So far, I'm really happy with the setup. It is nice to be able to focus on primarily using the keyboard and the opportunity to continue to customize my environment seems like a healthy way of improving my knowledge of *nix and programming in general. What's more, it is nice to know I'm primarily using free software again. Beyond things not costing much, I have the opportunity to do whatever I like with the code. It may not seem like a big deal, but knowing that I have the ability to change the code as I need to is a pretty powerful concept.