Robilim.com - Online Portfolio http://www.robilim.com/ Just some articles that I have supplied on my website. .htaccess 301 force redirect directory to a subdomain http://www.robilim.com/article-item/14/htaccess-301-force-redirect-directory-to-a-subdomain/ I recently came across a situation that required some attention with htaccess regex. This example I needed to send a folder on my server to a sub domain that had been created.Eg. http://www.my-site.com/subfolder/ -> http://subfolder.my-site.com/.htacce... .htaccess 301 redirect clearing get and post variables http://www.robilim.com/article-item/2/htaccess-301-redirect-clearing-get-and-post-variables/ Just an issue I have come across recently on my website, so I thought I could share my problem and the resolution. Problem: Member's login was not working after I added the following .htaccess lines of code to redirect non-www address to www address: R... Apache : Setting up sub domains on localhost http://www.robilim.com/article-item/4/apache-setting-up-sub-domains-on-localhost/ Intro Recently I've been trying to setup subdomains to run on my localhost. This will come in handy for testing html code before putting a site live. Note I'm running Apache 2.2.11 on Windows XP. The example of a subdomain is http://localhost/mysite acce... Clear HTML cache via meta tags http://www.robilim.com/article-item/9/clear-html-cache-via-meta-tags/ This is just a simple note that is handy to know when you are only using HTML to stop cache. It has been helpful for me to stop images from caching when I was cropping the image and saving under the same name.<meta http-equiv="Pragma" content="no-cache... Disable enter key on form submit - (keycode 13) http://www.robilim.com/article-item/13/disable-enter-key-on-form-submit-keycode-13/ I needed to disable the enter key on a particular form field and was able to find this solution.$('input#form_id').keypress(function (event){ return event.keyCode == 13;});Note that this is a simplified version of what I did, but basically it returns fals... Firebug Plugin in Firefox - a big time saver - find bugs faster http://www.robilim.com/article-item/17/firebug-plugin-in-firefox-a-big-time-saver-find-bugs-faster/ If you haven't played around with firebug before - or even used firefox, it would be a good thing to explore if you are a web developer. Of course this is a very general article but it will cover some of the uses that I have for firebug on a regular basis... Form element attribute not changing via javascript http://www.robilim.com/article-item/10/form-element-attribute-not-changing-via-javascript/ "It just doesn't make sense!"I definitely said this many times until I managed to figure out why I couldn't change a form attribute via jQuery or even raw javascript. In order to illustrate this I'll give an example.Example:Aim was to change the form acti... Javascript Plugin not working on AJAX loaded content http://www.robilim.com/article-item/11/javascript-plugin-not-working-on-ajax-loaded-content/ This is a common little problem I've come across a few times, and the first time it happened it took damn long to find the answer. The main case that I come across this issue is when a have popup jQuery plugins such as thickbox or colorbox which load an i... Javascript setMonth() bug - Why is the date not working? http://www.robilim.com/article-item/20/javascript-setmonth-bug-why-is-the-date-not-working/ Recently I was doing some javascript date checking and recently encounted bugs that only occurred towards the end of the month. Today being the 31st May 2011 was the key to the problem.var arrivalDate = new Date(); arrivalDate.setFullYear( $('#arrival-yea... jQuery : simple event listening technique http://www.robilim.com/article-item/6/jquery-simple-event-listening-technique/ Event listening in jQuery has served me well when doing small custom events. It helps to use this technique so that the majority of browsers support the code being executed. A typical example for using event listening is when I a click or change event ha... jQuery running with prototype http://www.robilim.com/article-item/18/jquery-running-with-prototype/ jQuery was nice enough to add in a function that helps with conflicting scripts. Typically prototype and jQuery use the $ sign to initialise their scripts. Code to help you achieve no conflicts://include your prototype//include your jquery//typical jQuery... jSON IE bug jquery .ajaxSubmit() - badly formed jSON http://www.robilim.com/article-item/15/json-ie-bug-jquery-ajaxsubmit-badly-formed-json/ BackgroundRecently came across this problem, on a site that was already programmed by someone else, which turned out to be something simple in the end. There was a click event on a submit button that would then fire off an ajaxSubmit with a jSON response.... Left2RightBounce : JQuery Image Scrolling http://www.robilim.com/article-item/5/left2rightbounce-jquery-image-scrolling/ Image ScrollingThe concept of this plugin was to create an image scroller that can move to the right and then back to the left. The ones that were out there were a bit buggy when the items were travelling slow and went outside the contaniners. This is pre... Simple show and hide toggle http://www.robilim.com/article-item/1/simple-show-and-hide-toggle/ Welcome to the first ever tutorial that I have done. I though I'd start with something simple. HTML wise you will need a link and a div box. The link will need an id attribute of 'click-item' and the div will need an id attribute of 'show-hide'. $("#clic... SVN command line tips - SVN Log http://www.robilim.com/article-item/16/svn-command-line-tips-svn-log/ IntroRecently I've had to learn some command line SVN rather than using GUI interfaces like TortoiseSVN. I'll try provide some little tips to find the logs of a repository.Plain commandsvn logAbove : The command to show all the revisions that affect the f... SVN Ignore directories recursively http://www.robilim.com/article-item/19/svn-ignore-directories-recursively/ Recently needed to ignore a set of directories in SVN so that all the uploads weren't being saved into the repository.svn -R propset svn:ignore '*' path/to/folderSo running through the code "-R" is the recursive flag and is case sensitive! "propset" is se... SVN Workflow http://www.robilim.com/article-item/3/svn-workflow/ I use subversion for mainly snycronizing websites but it can be used for other applications as well. This article covers a standard workflow using TortoiseSVN, and I also assume SVN has already been setup on your computer or network. Import the folder in... Transparent image 1x1 displaying in weird IE8 http://www.robilim.com/article-item/12/transparent-image-1x1-displaying-in-weird-ie8/ Came across a weird bug when I made a 1x1 semi-transparent .png image that repeats for a background on my website. IE8 renders it as a gradient!!! It get's even wonkier when you try to scroll your window or mouse-over content. I had already tested this si... Turn off autocomplete - disable cache on form inputs of HTML Pages http://www.robilim.com/article-item/8/turn-off-autocomplete-disable-cache-on-form-inputs-of-html-pages/ Most of the time having auto complete on form inputs is great, especially as a developer when you're constantly filling out forms to test data. I recently came across an instance where the auto complete was overiding my AJAX scripts on keyup. To cure this... What you may not know about IF statements, ternary operators explained. http://www.robilim.com/article-item/7/what-you-may-not-know-about-if-statements-ternary-operators-explained/ Traditional IF statements can take up more lines than you would like to. Especially when its only a small condition. Ternary operators take three arguements condition, true, false. This can be contructed on one line as opposed to the tranditional way whic...