Example:
https://gist.github.com/jmzcray/52f489afac1fa80b719f
Wednesday, 15 October 2014
Tuesday, 14 October 2014
Sublime - search and replace text
Suppose I have multiple files that I want to replace the URL with something like follow:
www.something.com to
www.qa.something.com.au
Here is what to do:
Find:
Replace:
www.something.com to
www.qa.something.com.au
Here is what to do:
Find:
www.([a-z]+).com
Replace:
www.qa.$1.com.au
Thursday, 2 October 2014
JSP/JSTL EL lastIndexOf
References
http://www.willuhn.de/blog/index.php?/archives/425-lastIndexOf-in-JSTL.html
http://www.tutorialspoint.com/jsp/jstl_function_substring.htm
Example:
http://www.willuhn.de/blog/index.php?/archives/425-lastIndexOf-in-JSTL.html
http://www.tutorialspoint.com/jsp/jstl_function_substring.htm
Example:
<c:set var="text" value="This is a bunch of text" />
<c:set var="splittext" value="${fn:split(text,' ')}" />
${fn:indexOf(text, splittext[fn:length(splittext)-1])}
Git delete branch
Delete local branch
git branch -d [branchname]
Delete remote branch
git push origin --delete [branchname]or
git push origin :[branchname]
The second way is basically saying "push nothing to remote [branchname]"
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/
To set a shortcut key:
edit the file as follow:
- Right click on the file in the editor
- Reveal in Side Bar.
To set a shortcut key:
- Preferences
- 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:
Remove / Discard unstaged changes:
Documentation for git clean:
http://git-scm.com/docs/git-clean
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
Subscribe to:
Posts (Atom)