Erik Zaadi

The tales of a coding manager addicted to dad jokes

Recent Posts

Host Automatic updatable Air applications on Github

For the impatient, check out the demo | source..

Intro

Creating desktop applications in Air with html and JavaScript is a joy for any web oriented developer. You get the same environment to work in, jQuery included, and the ability to create desktop based applications fast. The only thing problem you encounter is the switch in concept of updating the desktop application with a new version. It’s no longer as easy as updating the site, you need to get the user to download the update..

jQAPI Air Application

For the last year and a half I’ve been heavily exposed to a lot of open source software.

It started out with a small conversation mentioning jQuery (Thanks Tim!), and since then I’ve been amazed by the open source community.

The great thing about open source is that you can pay back to the people that created software that you like (Yes, the price is also nice, of course).

I’ve been using jQAPI by Sebastian Senf (@mustardamus), which is an alternative (and in my personal opinion better) documentation for the jQuery API framework.

Compress Javascript with Google Closure Compiler in Visual Studio (with jQuery support)

Google Closure Compiler is an amazing tool. Besides having the best compression rate (and being the official choice of jQuery), it really alters the way you write javascript.

When using the Advanced Optimization option, it forces you to write more concise code, exposing only what really matters to the global namespace.

There’s a lot more the be said in that matter, but that’s material for a future post about how Google Closure Compiler changed the way I write jQuery plugins.

Update - jQuery Print Element version 1.1 Released

Changelog:

  1. Fixed a bug (calculating the base href for embedding css when not using port 80, see issue).

  2. Added a small feature, the entire element is cloned, ensuring that all attributes are added to the element in the generated print page (see feature request ).

Links:

Download | Download (Minified) | Documentation | Issues (Report a bug) | Official jQuery Plugin Page

By the way, all of my jQuery plugins have been tested with jQuery 1.4.1..

jQuery 1.4.1 vsdoc (Visual Studio 2008 IntelliSense)

  For those of you who can’t install asp.net mvc 2 rc2, here are the vsdoc files for jQuery 1.4.1 :

  http://demos.erikzaadi.com/js/jquery-1.4.1-vsdoc.js

http://demos.erikzaadi.com/js/jquery-1.4.1.min-vsdoc.js

The release also includes the vsdoc files for the jQuery validate plugin:

http://demos.erikzaadi.com/js/jquery.validate-vsdoc.js

http://demos.erikzaadi.com/js/jquery-1.4.1.min-vsdoc.js

Enjoy,

Erik

Working with Github from within a company firewall

Most companies with somewhat restricted firewall rules typically enables only web traffic using port 80 or 443 (for SSL).

Git is communicating with Github using port 22 (or the default 9418), which in my own case was blocked after a while.

To keep “gittin” from work there are some options.

  1. Work with pure http access (port 80) git clone http://github.com/username/repository.git This will only give you read only access and is rather slow

Using Mvc user controls from another controller

I needed to use a user control from a different controllers folder in a view.

Should be easy I thought, there’s probably an overload for the Html.RenderPartial that with the controller name.

Unfortunately, that’s not the case.

If you look at the solution layout below:

I needed to user the OtherControl.ascx from the Home controllers views.

Passing only the user control name to the Html.RenderPartial won’t work, and you’ll end up with an error like this:

The beauty of the desert

A bit off topic perhaps, but I have to admit, I love the desert..

Cheers,

Erik

Asp.Net MVC Exception Handling with jQuery

I stumbled upon this excellent post by Sumit : http://2leggedspider.wordpress.com/2009/12/22/handling-exceptions-using-jquery-and-asp-net-mvc/

I thought the idea was great, but the fact that you need to parse it as JSON bothered me.

Since the information needed is only the status code, stack trace and error message, it seemed more appropriate for me to use the existing http response parts that are designed to pass those values.

For the impatient:

Demo | Source

[Update] Altered the code with @Neal, and @Colin’s feedback..

I created a filter that inherits the default [HandleError] Attribute.

Blog Migration – Part – 4 – Connecting Windows Live Writer to the AtomSite blog

Previous Posts : 1 | 2 | 3

This post took me a while to get together, it’s actually the first blog post I’m writing from Windows Live Writer on this blog..

To be able to write and manage posts efficiently, you need to connect with a good desktop program, with offline capabilities such as preview, saving drafts etc.

Windows Live Writer is the perfect application for me, as unfortunately I don’t get to spend much time on the Mac side of life..