Possible to add custom controls/buttons in the gutter?

Is it possible to expand the gutter, and for example add custom checkboxes/switches in there?

Yes, see setGutterMarker.

Is there any code example? I cant really understand codemirrors documentation …