• Four Steps to Turbocharge Rails + AJAX Development with Nginx and Foreman

    If you’re developing a chatty AJAX app on Rails and using a single mongrel to run it on your workstation, you probably are a bit annoyed with delays waiting for requests to be fulfilled one-at-a-time. So, here I’ll walk through the steps to run your own “cluster” on your OS X workstation using Foreman and Nginx.

    In the course of building the frontend application for Earbits, I’ve been constantly annoyed with the responsiveness of my local development server. As a pretty complex AJAX application, there are lots of little (and some bigger) calls to the Rails backend APIs to do lots of potentially slow things. This means that there are lots of calls that are originating in the browser and being served by one mongrel, so the server ends up handling requests too slowly. Which leads to me being frustrated. Which leads to me finding a nice solution to the problem.

    (more…)


  • A User Friend Relationship Model in Rails

    In building my first Ruby on Rails app, I needed to create a facebook / social-networking style friend relationship between users. The simple requirements were that it the friendship should require approval (e.g. a friend request followed by an accept or ignore) and it should be lightweight (not using two records for a single relationship).

    This method and code is inspired by two blog posts, which got me started but neither of which really fulfilled my complete requirement. The first used two records per friendship and the second was a twitter-style friend/follower without the approval process.

    So, here I break down my Friendship model which hopefully you will find useful and/or insightful as a complete solution or a starting point for your own implementation.

    (more…)


  • Sphinx Search C# .NET Client API

    Need a C# native client API for Sphinx Search to use in your C# or VB ASP.NET projects? So did I, so I wrote one.

    Yesterday, I found Sphinx Search and decided to try implementing it in place of the (horrid) MySql Fulltext searching for my Photocore project. After downloading the binaries and indexing a couple million rows of metadata, I was amazed at how well it performs. It indexed all my data in less than a minute (compared to the 30 minutes required by MySql Fulltext) and I haven’t come up with a search that takes longer than 0.005 seconds. I was hooked immediately. So I needed a .NET API because I didn’t want to patch my database server to use the Sphinx plugin.

    Source download after the jump.
    (more…)


  • Build your own modded System.Web.Extensions.dll

    Earlier today Microsoft released the source code to the AJAX 1.0 release System.Web.Extensions library. I was in the apparently unique position of needing to modify parts of the code for a special case application, so I downloaded the source right away ready to modify, compile and deploy.

    I guess I was pretty naive to think that it would be that easy. The distribution doesn’t include some pretty important parts. A .csproj file for one. The entire Resources class for another.

    So I had to work my way through the process of getting a compile-able version of the library ready to replace the official System.Web.Extensions binary in my project. The server code Reference License prevents me from simply providing the project to you, but here are the high points if you need to do the same.
    (more…)


  • GCalendarSync - Update

    Bugs fixed in this release:

    • All-Day events now are imported onto the correct day (instead of a day early)
    • Non @gmail.com usernames are accepted. If you use “thegooley” it will assume “thegooley@gmail.com”, but you can also use “thegooley@hotmail.com” by providing your entire email address
    • The FAILED error message has been modified to display the actual error text, so please report what it says when you post about a problem
    • Error log file changed from ApplicationDataGCalSyncGCalSyncErrors.xml to GCalSyncErrors.txt (it was never actually an XML file, but was named that due to an oversight by me)

    Download after the jump
    (more…)


  • GCalendarSync v0.2 Fix

    This is going to sound a little presumptuous, but it looks like something Google is doing changed last night and broke their code library for their API.

    Download installer cab (updated 12/25/06)

    What happened?
    In the gauthrequest.cs file, provided by Google, lines 408-9 look like this

    // check the content type, it must be text
    if (!response.ContentType.Equals(HttpFormPost.ContentType))

    and this was working until last night. In this case HttpFormPost.ContentType = “text/plain”. Problem appears that now, the response.ContentType of the authrequest is being returned as “text/plain; charset=utf-8″. So that .Equals conditional no longer does the right thing, thus the authentication breaks.

    To fix, I change line 409 to

    ...ContentType.StartsWith(HttpFormPost...

    Now all is well again. Re-install and give it a go. I guess this is going to be standard for interfacing with a “beta” Google API. And we’ll just have to get used to it…


  • GCalendarSync v0.2 Release + Source

    What is GCalendarSync? Go to the project page

    Download installer cab | source

    If you just want to use it on your mobile, hit that binary cab link from pocket IE and it will install for you. No, I didn’t sign my assemblies (i don’t have a real certificate), so be prepared to click through some warnings. You’ll need the .NET 2.0 Compact Framework installed for this app and you can get it from Microsoft here.

    I have been using it for a day now with no issues but all the usual disclaimers apply. Use it at your own risk. I’m releasing this under the Creative Commons Attribution-ShareAlike 2.5 License. Share it and Remix it, but let me know what you’re doing with it so we can enjoy it too.

    Oops… It just came to my attention that there’s already something out there called GCalSync. Wow it’s a small world. That app is *shiver* in java, so I need a new name for this app! Suggestions please :-)

    More detailed release notes after the jump…
    (more…)


  • GCalendarSync v0.1 Screenshots

    GCalendarSync allows you to import events from one or more of your Google Calendars directly to your Windows Mobile PDA or Smartphone over the air using GPRS, without docking or using Outlook or the desktop computer in any way. Release + Source is coming later today. Coming in a couple days is the reverse-sync feature so that you can make changes to your google calendar directly on the Smartphone and changes will sync back up to Google.

    I’m not quite ready to release it this second, so here are some screenshots of the process of using the app. Like all Windows Mobile apps, after you close it it can still run in the background, so that allows it to run scheduled imports. Basically every minute it hits a timer interval and checks to see if it should import again (default time between imports is 60 minutes). Right now it is more of an Import than a “Sync” tool. But in the next release I will should have two-way syncro going so that you can make changes right on your phone and have those changes sent back up to Google…

    And now, the screenshots (after the jump)
    (more…)


FRESH / LATEST POSTS

FRESH / Twitter Updates