Thursday, January 25, 2018

Basic git command to create a new branch revert changes in a branch

`git checkout staging`
`git pull`
`git checkout -b ES-205 #create a new branch`
`git push --set-upstream origin ES-205 #push the new branch`
`git checkout staging`
`git revert _____ # revert the commits you made on staging`

Monday, December 4, 2017

Online Learning Resource

https://anewkindofhuman.com/dozen-places-educate-online-free/

Friday, November 10, 2017

JumpList in WPF application



Reference to JumpList in WPF application

https://blog.codeinside.eu/2015/11/30/working-with-jumplists-in-wpf-apps/

https://msdn.microsoft.com/en-us/library/ff770767.aspx

Creating JumpLists via XAML

Small warning: If you try this on Windows Vista, your app will just crash…
JumpLists are registred per application and the easiest way to create a (static) JumpList is via XAML in the App.xaml:
http://schemas.microsoft.com/winfx/2006/xaml/presentation
" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml">

Creating JumpLists via Code

The “coding” JumpList API is a bit odd to use, but still easy to understand:
var jt = new JumpTask
{
    ApplicationPath = "C:\\Windows\\notepad.exe",
    Arguments = "readme.txt",
    Title = "Recent Entry for Notepad",
    CustomCategory = "Dummy"
};

JumpList.AddToRecentCategory(jt);



var jt2 = new JumpTask
{
    ApplicationPath = "C:\\Windows\\notepad.exe",
    Arguments = "readme.txt",
    Title = "Code Entry for Notepad",
    CustomCategory = "Dummy"
};

var currentJumplist = JumpList.GetJumpList(App.Current);
currentJumplist.JumpItems.Add(jt2);
currentJumplist.Apply();
The “Apply()” call is needed, otherwise the new JumpItem will not be added. As you can see, you can create new JumpList entries, add (and I think you could also remove items) from the default recent category. Besides JumpTasks there is JumpPath, which just contains a link.
In the XAML Part I also hooked up some events, so your application can get notified when a user pins something or removes something which you might want to handle.

Wednesday, November 1, 2017



Reference to article
https://justenglish.me/2012/09/01/free-books-100-legal-sites-to-download-literature/

Monday, August 21, 2017

MVC Sample to send current url while redirect to another page

public ActionResult MyNextAction()
{
    return Redirect(Request.Referrer);
}

public ActionResult MyFirstAction()
{
    return RedirectToAction("MyNextAction",
        new { r = Request.Url.ToString() });
}

then:

public ActionResult MyNextAction()
{
    return Redirect(Request.QueryString["r"]);
}

Friday, August 18, 2017

jQuery find td data

Simple jQuery Selector to highlight selected table row  
and get table data
value




$(SELECTOR_TR).click(function (e) {
                var val= $(this).find('td:eq(1)').text();
                 $(SELECTOR_TR).removeClass(CSS_CLASS_TR_SELECTED );
                $(this).addClass(CSS_CLASS_TR_SELECTED);
            });


Get selected text from dropdown


                           


 $('#SelectOption').find('option:selected').text();


https://stackoverflow.com/questions/4376664/jquery-access-input-hidden-value
You can access hidden fields' values with val(), just like you can do on any other input element:
 type="hidden" id="foo" name="zyx" value="bar" />

alert($('input#foo').val());
alert($('input[name=zyx]').val());
alert($('input[type=hidden]').val());
alert($(':hidden#foo').val());
alert($('input:hidden[name=zyx]').val());
Those all mean the same thing in this example.

Thursday, July 13, 2017

Example for git rebase and git rm

https://git-scm.com/book/en/v2/Git-Branching-Rebasing
$ git checkout experiment
$ git rebase master
https://stackoverflow.com/questions/6313126/how-to-remove-a-directory-from-git-repository
git rm -r --cached myFolder