• Programming

    Posted on July 25th, 2009

    Written by Emad Ibrahim

    Tags

    ,

    jQuery Wildcard Selector

    This post is a reminder for me on how to do wildcard selection in jQuery.  It comes up more than you think and for some reason, I can never remember it. <div id=’pnlUsers’></div> <div id=’pnlMessages’></div> <div id=’pnlStatus’></div> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ [...]

  • Programming

    Posted on July 5th, 2009

    Written by Emad Ibrahim

    Tags

    ,

    Regular Express For Parsing URLs

    I am always looking for this one, so I am blogging it for future reference and for everyone to use. ^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~/|/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$ There is more information on Ivan’s blog.

  • Programming

    Posted on May 7th, 2009

    Written by Emad Ibrahim

    Tags

    , , , , ,

    Shortening URLs with bit.ly’s API in .NET

    Shortening URLs with bit.ly’s API in .NET

    I previously wrote about shortening URLs with TinyURL’s API but my new favorite URL shortener is http://bit.ly and it also has a great API that you can use from within your .net code.  I just recently used in my twitter contest website – tweetastica. The code is also very simple.  I didn’t add all the [...]

  • ASP.NET MVC, Programming

    Posted on October 2nd, 2008

    Written by Emad Ibrahim

    Tags

    , , , ,

    Themes and ASP.NET MVC

    I wanted to easily add theme support to yonkly, so that others can install it and modify its look and feel as they please.  I also wanted it to be as easy as installing a theme in wordpress. I created a themes folder under the content folder Then I referenced my css file in the [...]

  • ASP.NET MVC, Programming, Testing

    Posted on August 27th, 2008

    Written by Emad Ibrahim

    Tags

    , , , , , , , , ,

    Mocking and Dependency Injection in ASP.NET MVC

    Here is the situation, my controller constructors take multiple interfaces as parameters.  I do this in order to use constructor injection which allows me to inject the controllers with mocked objects in my unit tests. For example, my AccountController takes IEmailService, IFormsAuthentication and MembershipProvider (abstract class) as parameters. During my testing, I want to mock [...]

  • Older Posts Yeah! There are more posts, check them out.

    Newer Posts Yeah! There are more posts, check them out.