Thursday, 25 September 2014

Sublime Text - reveal in sidebar

http://julianhigman.com/blog/2013/07/23/sublime-text-3-keyboard-shortcut-to-reveal-file-in-sidebar/

  1. Right click on the file in the editor
  2. Reveal in Side Bar.

To set a shortcut key:
  1. Preferences 
  2. Key Bindings (User)


edit the file as follow:
[
 { "keys": ["ctrl+shift+r"], "command": "reveal_in_side_bar"}
]


Wednesday, 17 September 2014

Git - remove / discard changes

If the changes have been commited to local branch but not yet push --

Reset local branch to repository:
git reset origin/develop
git reset HEAD


Remove / Discard unstaged changes:
git clean -df
git checkout -- [file]


Documentation for git clean:
http://git-scm.com/docs/git-clean

Friday, 29 August 2014

Adobe AEM/CQ - cq:Page redirect

Out of the box redirection for cq:Page type settings are as follow:


  • jcr:content
    • redirectTarget | String | /[path]/[to]/[redirect]
    • sling:redirect | Boolean | true
    • sling:redirectStatus | Long | 302
    • sling:resourceType | String | foundation/components/redirect

Thursday, 28 August 2014

Git - when to merge and rebase

http://www.derekgourlay.com/archives/428

" Rebases are how changes should pass from the top of hierarchy downwards and merges are how they flow back upwards. "


Rule of thumb:

  • When pulling changes from origin/master onto your local branch, use rebase.
  • When finishing a feature branch merge the changes back to develop.


Rebase

git pull --rebase
or
git fetch origin
git rebase -p origin/[master]


Merge

git checkout master
git merge [branch]

Monday, 25 August 2014

45 ways to avoid using the word 'very'


“So avoid using the word ‘very’ because it’s lazy. A man is not very tired, he is exhausted. Don’t use very sad, use morose. Language was invented for one reason, boys - to woo women - and, in that endeavor, laziness will not do. It also won’t do in your essays.” 
― N.H. Kleinbaum, Dead Poets Society


Wednesday, 20 August 2014

Adobe AEM/CQ - remove whitespace from generated HTML

http://www.wemblog.com/2014/07/how-to-remove-white-space-from.html

1) trimDirectiveWhitespaces
<%@page  trimDirectiveWhitespaces="true"%>

2) Use
--%><%--
tags to start and end scriplets tag and in between html tag

3) Create your own tag library and using html parser remove white spaces during run time. for that check http://www.cqblueprints.com/tipsandtricks/jsp-custom-tag-lib.html

4) Use Google Page Speed Module at apache.