occasionally useful ruby, ubuntu, etc

6Dec/090

LockNLoad is…locked and loaded?

I've just completed and pushed the initial version of LockNLoad, a Spring-like Inversion of Control container for Javascript, which follows the dependency inversion principle (I think I'm getting all these terms right...). Given the proper configuration, you can simply say LNL.$("my_id") and get a prototype or singleton object or function. Read on for more information.

7Nov/093

Cool free hosted tools for your Ruby webapp

Some of these are obvious (i.e. get exceptional, hoptoad), many of these aren't Ruby-specific, but I thought it might be nice to put all these in one place, at least for my sake.

Exception tracking

Get Exceptional limit: 1 app
Hoptoad limit: 1 project, 2 users

Bug tracking:

there's github, of course, if you're already using that...
16bugs limit: 1 project
I'm not including full hosting platforms, like Google Code here, but you could use those, too

Email

One-off emails (i.e. signup)

Sendgrid limit: 200 emails/day
GMail allows 500 emails/day, but doesn't offer all the doodads that Sendgrid does

Mailing list (i.e. newsletter)

Mailchimp limit: 500 subscribers, 3000 emails total a month

Customer Support

SnapABug limit: 10 reports/day
uservoice limit: 100 unique users/month
GetSatisfaction limit: 0 official reps, not hosted on your url

Analytics

There's a ton of options in this space, but I use:
Google Analytics limit: no limits, because it's The Goog
Clicky limit: 1 website, 3000 hits/day

Metrics, Monitoring

New Relic limit: no troubleshooting, optimization, etc
Tripwire (Alpha, no immediate signup) for tracking validation errors.  limits not specified

User Avatar Hosting

Gravatar limit: none

Authentication

OpenID

RPX limit: up to 6 providers, instead of 12

Time tracking/invoicing

Harvest limit: 2 projects, 4 clients, 1 user

Help desk thing

Just kidding, couldn't find any free hosted help desk apps

Anything else I'm missing that every webapp needs?

Update 10/5/2010: added Tripwire

Filed under: ruby, webapp 3 Comments
31Oct/090

karmic koala finally

So I may have totally hosed my server in the process, requiring me to reimage the thing, but I finally have Ubuntu 9.10 running on it :P woot...

Filed under: Uncategorized No Comments
25Oct/090

Pleasantly Surprised: Windows 7 RAM reporting

It's the little things that show someone's listening at Microsoft that make me happy.
Vista, when it first came out, reported that I had 3.25 gigs of RAM in the System Properties dialog. Bummer, but to be expected when I put 4 gigs of ram into a 32-bit system.
Microsoft later released a "patch" so that instead of reporting how much RAM you had available, it would report how much RAM was /installed/ (aka, 4.00 GB instead of 3.25 GB). I, along with countless other nerds out there, were outraged that we had to download a third-party program to find out how much RAM was actually available.
Windows 7: Installed memory (RAM): 4.00 GB (3.50 GB usable). Huzzah! Don't know where the extra 0.25 GB came from, but at least they're trying, right?

New little discovery -- "progress bar" applications, like copying files, have their progress bar /in the system tray/. How cool is that?

*still writing this post from Ubuntu :) *

Filed under: Uncategorized No Comments
10Sep/092

Debugging unobtrusive javascript in jQuery

So if you work for a large enterprise website like I do, where each page loads dozens or hundreds of kilobytes of javascript, it can be hard to figure out exactly what happens when you click that div and something magically happens, due to the wonders of unobtrusive javascript.

Or, to rephrase the question, "I know how to add event handlers to an object -- how do I enumerate what's already been attached?"

And it's pretty easy, but unfortunately it doesn't use a public API. Anyway, try this in Firebug:


$("#the_button").data("events");

If there are any events on that element, they'll be displayed. The only drawback is...you have to know exactly which element the events are attached to, or guess around a bit.

Enjoy!

5Sep/090

IE + AJAX + Redirects

So we made an interesting discovery these past days...IE handles some redirects in AJAX really, really badly.

This table explains:

Redirect URL
To itself To another page
FF Redirect 18-20 times Didn't test
IE Redirect until you close the browser Redirect 10 times

(By "redirect to itself" I mean you have some bug in your logic such that page http://example.com/?page=1 will redirect to itself indefinitely.)

Do you like that "redirect until you close the browser" one? Even if you go to a completely different site, the browser will still be making requests to yours.

Moral of the story: be very careful with redirects with AJAX.

Filed under: internet No Comments
24Aug/097

Banks and OAuth support

For fun, I decided to ping all of my financial companies (Bank Of America, CapitalOne, Chase, EmigrantDirect, INGDirect, Vanguard) about their plans for OAuth support. I don't know how many of you use the wonderful service known as Mint, but I like it a lot. Unfortunately, a part of me died when I gave them my username/password for my banking sites. And INGDirect is secure enough that Mint can't even interface with them! Sorta cool.

Anyway, here's what the institutions said:

10Aug/090

Web server output generation design patterns

There are several styles of content generation that I know of so far...I'm reviewing them because I'm looking to see if there could be something better.

Flat-file

Example: plain ol' PHP

PHP, at its simplest, doesn't have any separation at all -- you can, if you choose, have all the programming/form-processing logic in the same file that renders the output to the browser.  While simple, if you're creating a full website, this can be cumbersome and confusing.

Filed under: musing Continue reading
9Aug/092

phew

Migrated from Slicehost to Rackspace Cloud (which is basically the same company). Should save me $10 a month! Moving databases and service configurations over is a pain, though.

19Jul/090

Design pattern/flow for building a website

So here's how I normally do things:

  1. Do as much of the models as possible in this first pass, skipping validation but including schema stuff
  2. Stick a couple things into the controllers that I think I'll need
  3. Build out some of the views, giving them some basic styles
  4. Revisit the models to add validation, helper methods
  5. Build out the rest of the views, give them real styles
  6. Muse about specs, then give up before starting
  7. Put more stuff into the controllers
  8. Iterate on random components until you're done

Needless to say, I'm getting to the point where my lack of organization kills my mini-projects before I hit step 4, sometimes even sooner than that.  So I'm going to try a slightly more...conventional (or widely suggested, at least) approach:

  1. Create controllers with just enough information so that your pages will display.  No setting variables yet or other logic!
  2. Fill out the views with as much HTML and fake data as you need.  Site have a sign-in page?  Leave a link to "force sign-in" the user that simply sets them to an authenticated state.  All it should do is set a session variable
  3. Spec out the models.  Don't check for validation yet, just check for core functionality, i.e. there is a User table, the first user has a name of Foo and email of [email protected], etc.
  4. Fill out your model code so that the specs pass -- this includes migrations with sample data (these can be removed in a later migration).
  5. Spec out your controllers/views.
  6. Fill out your controllers/views so they pass specs.
  7. Do the rest of the little things that need doing, like validation, error messaging, authentication, styling, etc.
  8. Revel in having finished a project.

Hopefully I'll get further than step 3 this way! I'm going to try to focus more on content/frontend instead of getting bogged down in the backend, and I want to actually write specs.

Any comments/suggestions?

Filed under: musing, ruby No Comments