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 -


http://techlaboratory.net/smartwizard
- Demo, user registration, validation, detailed


http://www.wbotelhos.com/stepy/
- Validations, Style



http://jquerytools.org/demos/scrollable/wizard.html
- Good, you might need to change the styles etc.


http://www.noveltheory.com/Wizard/
- very basic

https://github.com/jackkeller/jquery-stepwizard
- Step wizard, again basic one

http://thecodemine.org/#

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

Pinterest



Sqoot


TechCrunch

Instagram

NounProject


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 - https://github.com/jpa/myproject.git

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 https://github.com/jpa/myproject.git

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 -



- http://www.browserstack.com/

- https://browserling.com/

- http://browsershots.org/

- http://crossbrowsertesting.com/

- https://browserlab.adobe.com/en-us/index.html

- 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 = "http://demo.myapp.com/api/v1/items/26/"
>>> from urlparse import urlparse
>>> o = urlparse(str)
>>> o
ParseResult(scheme='http', netloc='demo.myapp.com', path='/api/v1/items/26/', params='', query='', fragment='')

>>> o.path
'/api/v1/items/26/'


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


{{obj.item_value|default_if_none:"smile"}}

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)