Phase shifting of 50Hz signal
You do it by creating a windowed sinc filter that has a wide enough pass-band to preserve the energy of whatever it is you are trying to phase shift.  Instead of centering the sinc function, though, you shift it by whatever phase shift you want to introduce.  You then filter the signal, which will now have that phase shift.

As Jason states in his comment, what we really want is a time delay, which means convolving with an impulse.  The problem is that you can only do delays that are an integer multiple of the sample period with this technique.  We get around that by creating a low-pass filter in the form of a windowed sinc.  This is effectively the same as an impulse in terms of faithfully reproducing the signal-of-interest as long as the energy of the SOI is within the pass-band of the LPF.  We then convolve the LPF with a fractionally delayed impulse.  We do this by calculating the values of the underlying sinc function at those shifted time points.  

Because convolution is a linear operation convolving your signal with the shifted sinc is equivalent to convolving the signal with a fractionally shifted impulse function and then convolving it with a LPF.