Author Archives: stashell

Allocating arrays of function pointers in C

Dynamically allocate array of 2 pointers to functions returning int and taking no argument.

Statically allocate array of 2 pointers to functions returning int and taking no argument.

Read more »

How to include one bash script in another

The problem Let’s say we have two scripts, /foo/bar/utils.sh

and script /foo/bar/main.sh, in which you want to use function do_something_useful from utils.sh. The common incorrect answer You can easily… Read more »

C# snippet : JSONify object

One of my most favorite C# snippet is following oneliner useful when quick debugging or checking on something is needed.

Which returns String containing JSON representation of arbitrary C#… Read more »