Our big project at Panoctagon has a lot to do with time and dates, so we’ve been developing a series of Rails plugins that make our jobs easier. I had a lot of fun building this one, and I could see other people finding this interesting, so we decided to open source this one. I think it’d make a great addition to Rails core (if I do say so myself :P), but I am not really up to all the effort involved. Instead I created a simple to use, documented, and tested plugin that works with Rails!

So what does it do? Basically, it makes date month values more meaningful by adding a new Month class that can do complex(ish) calculations against the days of the month for you. It also allows you to treat a Month as an enumerable container, allowing you to iterate through the days of the month like an array.

Lets peek at some example snippets:

Getting The First Tuesday of September 2009

1
2
    Month.september(2009).first_tuesday #=> Date object
    Month.new(9,2009).first(:tuesday) #=> Date object

Getting Every Friday in August 2008

1
2
    Month.august.every_friday #=> Array of Date objects
    Month.new("August").every(:friday) #=> Array of Date objects

Getting Every Thursday and Saturday in June 2007

1
2
    Month.june(2007).every_thursday_and_saturday #=> Hash of Arrays of Date objects
    Month.new("June",2007).every(:thursday,:friday) #=> Hash of Arrays of Date objects

Getting The Last Monday in April 2005

1
2
    Month.april(2005).last_monday #=> Date object
    Month.new("April",2005).last(:monday) #=> Date object

Enumerating Through the Month of August 2008

1
2
3
4
5
   month = Time.now.month #=> Month object of the current time requested
   month.each do |day|
     day.to_s #=> Week day name ie: Saturday, Sunday, etc.
     day.to_i #=> Date value in context of the month ie: 1..31
   end

Other Odds and Ends

1
2
3
4
5
  Month.april.size #=> total number of days in that month
  Month.august.next #=> returns a month object populated with August
  Time.now.month #=> returns the current month in context to the #now response
  Month[5] #=> May Month object access as array index
  Month[:april] #=> April month object access as hash key

So, as you can see, it saves a lot of time and calculations and keeps it easy for you to treat months as essentially a container! Really useful for doing complex calculations against dates.

If you would like to use my plugin, feel free, I’ve released it under MIT, and its located at my github account. Please give me some props if you do, or send me a line.

If you are interested in my rdoc documentation, check our company’s documentation server. Let me know what you guys think!

10 points for most original title, ever.

Lately, my company and I have been looking into the benefits of switching to Git for source code repository management. Its currently the new “hotness” of the hacker world, and with some of the claims that I’ve read, its pretty hard to ignore.

Linus Torvalds has made a few references to how much he hates tools like Subversion and CVS, and he has a lot of interesting reasons for feeling the way he does. I don’t agree with everything, but then again, I am not writing a kernel. Subversion has worked great for me and my team in the past, but we are definitely starting to envy some of the Git advantages.

Its indisputable that Git makes it unbelievably easy to branch and tag your repositories, hands down. The bigger and more integrated my codebase and team is getting, the more of crucial of a feature that is to us. Decentralization is not a big deal to me. Frankly, I never am really “off the grid”, so most times I just do git commit followed by a push.

Fortunately for us, Unfuddle supports Git now, so its easy for us to use our existing project management tool with this new technology, at no extra investment! But, I have to take a moment to say, GitHub is definitely pretty killer. Unfuddle’s support for Git is new and will improve over time, but I am very very impressed with how well GitHub has nailed the integration. The biggest reason for me to move (some) of my code to GitHub is for the public aspect of it. From this point forward, I will be posting my company and I’s open source contributions there. Mostly because Unfuddle doesn’t provide external access to projects in the same way, which is actually sort of strange in my opinion.

Maybe in the future I will be so inclined to product an Unfuddle-Git bridge to keep my repositories (edit: there is one already, why isn’t this a part of GitHub yet?!) synchronized, for projects I plan to open source. Overall, I am pretty happy with Git, I think my initial impressions of it were tainted by the “growing pains” I experienced while trying to get it to work with Unfuddle. Seriously, with GitHub I was up and running with the repo in under 2 minutes!

You can check out my repositories here. There is one project there now that I haven’t talked about too much yet, mostly because I just built and released it in the last 72 hours. More on that soon!

Recently I attended the first ever Start Conference here in San Francisco, CA. The last segment of the day they did was a “Pitch Off”, which I thought was absolutely fantastic! Imagine American Idol + Startup Nerds + Hilarity, it was pretty much like that. I saw some really great presentations and some really bad presentations, but learned a ton from all of the above.

There was one startup in particular that really stood out to me as a product that is truly pushing the envelope, especially in a world of facebook++ mentaility when it comes to consumer internet products. That product was Apture. Apture is all about creating rich and interactive media linking. At first, I was like “wtf is that”, but their expertly-crafted powerpoint skillz made it very clear.

In essence, its a tool that allows you to make your links in your blog far more interesting, what do I mean by that? Well, since I have recently enabled my blog to use apture, via the wonderful wordpress plugin they provide after their 3 second sign up, let me show you. :)

It has all sorts of integrations with places and things that people use most often on the web, so for instance, if I were to tell you I live in Albany, CA, I could provide a simple little map right here on my page (click the link to see what I mean). Now, when you click on that link, you’ll notice a Google Map appears, I’ve also annotated that link with another link to a wikipedia article of my favourite local pizza place!

Cool or what? Now check this out.

Anyone who knows me knows that I love The Mars Volta and Radiohead, they are definitely my two favourite bands. Now, if you click on both of the band names, you can see the cool sorts of things that Apture does for you, with very little effort at all!

Really the only downside to this product is the centralization aspect, if their servers go down, so do my links :(

I am able to create these links on the fly, and make them as inter-connected as I choose! Apture is definitely one of the coolest web tools I’ve seen in a while and I encorage my fellow bloggers to try it out for themselves!

I am hooked on the religion that is known as GTD (Getting Things Done), and I have also become rather dependent on an application that follows the whole GTD way of, well, getting things done, known as Things. Its a fantastic application! But unfortunately, its not a finished work of art, just yet.

I’ve never played with OmniFocus before, and some people will call blasphemy right about now, but hear me out. The attraction to Things is its simplicity. It doesn’t get in your way with its opinion of how you should manage yourself, it just lets you tell it what you need to do, and its up to you to get crazy with it.

I love that! A tool that simply does what I want to do, the way I want to do it! CulturedCode, the company behind Things, has also released a fantastic Things iPhone app that brings the love on the road with you, awesome! It can’t sync with the desktop YET. Sync capabilities are coming within the next week, and I am very excited about that.

But I didn’t write this post to basically tell you why Things is so great, actually, quite the contrary. I think there are some big gaps in quality in Things, and I am hoping that CulturedCode hears me and maybe takes my thoughts into consideration. Maybe. :)

So, shall we begin?

Web Service Integration
What do I mean exactly? Look at a tool like Evernote. Seamless integration, your information is constantly synchronized. Not with ad-hoc wireless hacks, not with iPhone tethering, not with MobileMe, through good ol’ internets. Why would this be cool?

iPhone App: Include Proximity Capabilities
I have to say, this is a really neat feature of the OmniFocus iPhone app. It gives you your contexts based on how close you are around them, if you define a proximity (via address or something). I would love that!

iPhone App: Voice Notes
Sometimes the last thing I want to do is type on my little screen, I just want to take my “open loop” out of my head and make it go elsewhere, quick and easy! I know, this kind of thing gets dangerous when I talk about web integration, suddenly you’ve got larger file overheads, but compression algorithms can make this not a big deal, per se.

More In-Depth Syncing
What I mean by that is, if I “schedule” a task in Things for a specific day, or even a due-date. It should create a Calendar entry for me in iCal that corresponds. Obviously it has a concrete date (and sometimes a time), that is easily translatable to a calendar event.

That is all that is coming to me right now, really the biggest thing in my mind is web service integration. That would be killer, on so many levels. I really think thats the missing peice to this whole system, in my eyes…its also missing from OmniFocus (I think?).

Either way, Things is definitely worth taking a look at if you are into GTD, and have a mac.

This year, I’ve been attending more conferences than I had originally expected to. Although, I was disappointed I was not able to attend cf.objective this year (probably will be next, though), I was able to find a ton of interesting conferences, without having to leave the Bay Area! Really, my biggest inhibitor is cost of flying and general expenses revolving around travel (isn’t that everyone’s problem?). So, Its been a nice surprise to see there are a few great opportunities right here.

Here is a list of conferences I’ve been to and will be attending this year:

Start Conference (August 7th, 2008, $200)
This conference is located in San Fransisco, CA (at the fort mason center). Its all about Entrepreneurs and startup-y topics. Should be a lot of fun! Not too expensive either!

Start is a one-day conference in San Francisco designed for smart, talented Web people to take hold of their ideas, follow their dreams, and start their own companies.

You’ll hear from founders of successful startups, and learn from investors, lawyers, and others who can outline potential pitfalls. They’ll give you practical advice, tell their horror stories, and maybe lend you a little inspiration. If you’ve ever dreamt of taking the plunge, don’t miss this chance to hear from the experts!

Google IO (May 28th-29th, 2008, $400)
This was a fun concert. I am hoping my entire team will join me next time. I learned all about a ton of Google technologies, and even some more generic topics such as AJAX and web optimization techniques. This is a really fun conference (at the San Francisco Mascone Center) that will definitely be around next year…probably even bigger than the last! They treat you like you work for them while you are there, all meals free (and good), tons of candy (free), bean bags everywhere, pool tables, and an amazing after party (open bar) with video games and a concert by Flight of The Conchords…it was fantastic!

Google I/O is a developer gathering focused on pushing the boundaries of web applications using Google and open web technologies. Google engineers and web development leaders will lead you through two days full of in-depth breakout sessions on the latest technologies, hands-on Code Labs, and informal Q&A at Fireside Chats.

LinuxWorld (August 4th-7th, 2008, Free!)
The attraction for me to this conference is the free price tag. Its absolutely free to just walk the gigantic expo hall, which is always filled with free handouts, software, knowledge, and fun! One year I got to ride a mechanical bull that was running on a linux-powered USB stick, I won an iPod Shuffle for my efforts :).

Next year, I hope to attend either RailsConf 2009 and/or RubyConf 2009. I’d like to see how one of these goes, maybe…if I can swing it…a conference overseas? That would be fun! We’ll see.

When we first moved into our offices on Milvia street, we tried to keep costs low and used our cell phones insetad of buying into a couple of land lines w/ conventional phone service. This worked fine in the beginning, our needs were humble. For the most part, the cell was great, except reception in our building was definitely not consistent, nor reliable.

As we began to do more work with clients and move into new areas of work, we started to rely on our phones a bit more. We also had run into the need to send and receive faxes more than I think we should (anyone heard of e-mail? :)). Basically, it became clear to us that we needed to figure out some sort of phone solution.

At first, I was hesitant to buy into the whole concept of VoIP, even though countless people had recommended it for startups. We don’t have the fastest internet, and our stupid router didn’t support QoS until very recently, so that was another big deterrent to the idea for me. Altough, I was not able to find a conventional phone service that I thought made decent fiscal sense…AT&T wants a pretty hefty commitment for even the simplest plans, I just wasn’t happy with the idea of it. And also, what about PBX type features? Extensions would be nice, how about voicemail? $$$

So, this was becoming a mess for me, once I decided to bite the bullet and find a VoIP provider, which ones are legit? Packet8? Vonage? (short answer, no). I happened to stumble upon a company named Aptela, and started looking into their features. Call trees, extensions, digital faxing (what a concept!), unified messaging, the whole gamut basically. For a very affordable price! We dove in and decided to give them a shot, its something like $60 bucks a month for everything mentioned above.

The system only works with IP phones, so we purchased a couple of $100 Polycom handsets, plugged them in, and suddenly…the stars had aligned and we had a working phone system! To be honest, I was completely amazed with how easy it was to setup, and how great it sounds, even while dowloading large files! (thank you, QoS). Aptela is a fantastic service, so far I have had absolutely no complaints. Everything is 100% web-based and works just fine on my mac, as it should.

So long story short, If you are looking for an affordable, solid VoIP solution, I recommend Aptela!

Wordpress has just released version 1.0 of their mobile blogging application for the iPhone. At first, the thought of blogging with any substance from my iPhone was kind of funny, but quite frankly, they’ve designed a tool that is awesome at doing just that.

One of the coolest things about it, is its ability to work with not only Wordpress blogs from wordpress.com, but ALSO custom installs! Thank you XML-RPC! You can also manage multiple blogs via the application.

You have the ability to write drafts, and save them locally to your iPhone, you can edit and manage drafts or previously published articles from your iPhone, and you can even take pictures on the fly and post them! How neat! One thing I wish it had that it does not, however, is the ability to manage comments. It’d be nice to be able to approve comments on the road if I needed to.

All in all, a must have if you are a Wordpress user, very impressed with this application!

The good peole at FiveRuns have just recently released a gem to the Ruby community that allows their ActiveRecord-managed data models to now have built-in sharding and/or replication functionality…with just a few lines of code!

What do I mean by Data Sharding? Read on:

Specifically we needed two features to scale our mysql database: application-level sharding and master/slave replication. Sharding is the process of splitting a dataset across many independent databases. This often happens based on geographical region (e.g. craigslist) or user account (e.g. flickr). Replication provides a near-real-time copy of a database which can be used for fault tolerance and to reduce load on the master node. Combined, you get a scalable database solution which does not require huge hardware to scale to huge volumes.

They call this new gem, DataFabric. DataFabric makes it super simple (and DRY) to make your application scales to multiple database shards, or even just provide basic replication to different database servers if you so choose.

For me, the idea of having something so complex as data sharding built into the core of ActiveRecord is absolutely fascinating! You don’t have to have any sort of mysql_proxy business, or other strange DRb services running in the background, just essentially plug and play.

Lately, I’ve been doing a bunch of research around cloud computing, for no other reason other than I find it genuinely interesting. At my company, we’ve invested some money in dedicated servers for our staging and production application environments, and cloud computing offers a lot more flexibility, for a lot less, it seems on the surface.

The general equation is, cost per instance/hour. Which means 2 servers, at $0.10 an hour, is a grand total of $0.20! That’s not bad, but keep in mind, application servers run 24/7, so imagine the equation being more like 0.10*(2*72), that’s more like it. Bandwidth cost is also extremely low, its about on par with what we pay now, but also, its on a “pay as you need” basis, so we actually save costs if we are using them less, much more granular.

But what can you do with the cloud? Well, that was my initial question, what are the constraints? Basically, there are none. I have been doing most of my experimentation on Amazon’s Elastic Compute Cloud. Once you’ve got an account setup, you simply choose from their library of Amazon Machine Images (or AMIs), and define an instance for yourself of that AMI, as simple as a shell command! Seconds later, you’ve got a Debian, or CentOS, or even Windows server ready to take orders! Wow! Accounts come with nice features such as elastic VLANs, allowing account-level firewall protection, as well as elastic IPs which you can use to do some very interesting load balancing techniques, all of this power available to you for very little upfront cost. Its literally as simple as I’ve explained it, I was amazed at how quickly I was commandeering multiple debian instances in my account!

So whats the catch, there is always one, right? Indeed there is. If you shutdown or “terminate” an instance of an EC2 cloud, you will actually lose all applications and data. Most people would say, well come on, thats crap! How do you expect me to run a server on that!? Well, to that I say, how often have you completely powered down a remote server without having it reboot? The saving grace here is that reboots actually retain the application and data, you only lose it if you’ve terminated the box. So, to me, that seems like a pretty good deal, especially since Amazon makes it so easy for you to build private AMIs, why not just image your perfect system, back up your data on your (included) S3 share, and just bring it back up in minutes if you need to?

Seems like a winner to me.

This is definitely an interesting paradigm shift from hosting as I know it, I am definitely still in the sandbox phase with this stuff, but its definitely an interesting concept, who knows where it could take me and my company. If we decided cloud computing was the way for our staging environment, we’d see a saving of close to $1500 a year for just that server, thats some serious savings in my mind! Or what if we built our fully optimized server instance, made a private AMI of it, and were suddenly able to roll out 20 application servers in literally 10 minutes? That is truly amazing to me. Looking forward to seeing where this kind of technology goes.

Granted, I have not done a ton of personal research on this problem, but I have looked around a bit…anyhow, here is the problem:

My company is 100% Mac, except for our debian-based production environment. We are all running iCal to manage our milestones and meetings, but its really an adhoc solution, not as integrated as say…Exchange calendaring. I do know for a fact that there is an iCal Server, but I don’t really think its feasible to think I will be investing in an xserve + OS X server just to get my company a unified calendar.

Are there Unix-based solutions out there I can install on one of my Debian servers? I haven’t found anything very specific. I know that WebDav plays a part in all of this, is it just so elementary that there is no direct “solution” ?

Curious to see what others have done in this situation.

« go backkeep looking »