I know that there is a formula called Cauchy's integral formula for entire function $f$
$$f(a)=\frac{1}{2\pi i}\int_{C}\frac{f(s)}{s-a}ds$$
Where $C$ is a closure of a disc.
Is it possible that we consider different type of closed curve for example rectangle, and by special integral on this curve that we would calculate value of $f$ at any point inside this curve?
Yes. Actually, if you read the statement of Cauchy's integral formula, you will find it works for any rectifiable curve. In particular, yes, rectangular paths are fine.