Friday, November 30, 2012

jQuery Wizard Options

Recently I worked on a piece where we needed wizard like functionality, and I did little bit searching on different wizard options available in jQuery. Here are some of the options available with some comments. 

You can use the one which suits your requirements -
- Demo, user registration, validation, detailed
- Validations, Style
- Good, you might need to change the styles etc.
- very basic
- Step wizard, again basic one

Addition to this if you are planning to do more along with wizard functionality like registration form etc, I would recommend to use sisyphus.js. Its provides auto-save google docs/gmail like feature which leverage HTML5 - local storage to prevent your work when you accidentally close or refresh the page.

Thursday, November 22, 2012

Outage Pages

Here are some of the example of outage pages from various well-known sites -

Stack Overflow






will keep adding as encounter more..

Wednesday, November 21, 2012

Push new code to Github

Create new repository (push fresh code to github)

1. Execute below steps (commands) in your local first - (g
o to the folder which you want to push to github)

git init
git add .
git commit -m "Initial commit"

2. Create new repo on github (using add new repository)
e.g. MyProject -

3. Again go back to your local and use below commands to push the code

git remote add [name to use for remote] [private URI] # associate local repo to the remote
git push [name of remote] master # push your repository to the remote

Sample steps for it -

git remote add origin

git fetch origin #It will pull the ReadMe file from git repository which you created on it.
git merge origin/master #Merge the changes with the local files.
git push origin #push the code.

All Set :)

Thursday, November 8, 2012

Browser Test

Test your web application on different platforms to see how it comes up on different OS and different browsers -






- IETester

browserstack and browsershots are really good.

Feel free to add to the list.

Wednesday, November 7, 2012

python url parse

Python got awesome module called urlparse. When you want different values from url, you might think of doing substring. Which is very risky and bad practice.

Here is the simple and easy way to do it in python -

>>> str = ""
>>> from urlparse import urlparse
>>> o = urlparse(str)
>>> o
ParseResult(scheme='http', netloc='', path='/api/v1/items/26/', params='', query='', fragment='')

>>> o.path

That was easy!

You can do much more using this module, please checkout the more details on this Reference link.

Sunday, November 4, 2012

git cache issue (.gitignore)

Run into strange issue today, i had added few files/path of the files in .gitignore, though while doing git status it were keep coming up. I explicitly specified the file names in .gitignore, however it ignored my additions to .gitignore :(

After spending some time, went to stackoverflow/google and figured the solution.

If you running into similar issue,  following is the solution:

Remove the cache -
git rm -r --cached .

This removes everything from the index, then just run:
git add .

Commit it:
git commit -m ".gitignore cache fix"

It should be fine now, check -
git status

Null Check in different language

Python - Null Check

15 or "default"       # returns 15
0 or "default"         # returns "default"
None or "default"    # returns "default"
False or "default"    # returns "default"

Django Template - None Check


C# - Null Check

var data = val ?? "default value";

Java - Null check

Foo f = new Foo();
DummyObj obj = new Obj().getSelection();
String str = obj != null ? f.format(obj) : "";

Javscript - Null/Undefined check

if (! param) param = "abc";
//other way to check this
if (param == null) is same as if(!param)

jQuery - Null/existence check

if ( $('#myDivObj').length ) {}

Feel free to add comments and other languages Null check mechanism (inline or explicit)