Bizarre Ritual With Snake and Incense

My wife and I were walking down the street in Pasir Ris, intent on exploring the area.  We spent most of last weekend moving our stuff, so there wasn’t much time to do anything special.

As we walked by these two guys, I heard a snapping sound, so I stopped to take a look at what was going on.  One of the guys was holding what looked to be a preserved cobra that had been turned into some sort of whip, with the head and hood and skin intact.  He would hold the snake over his head, as seen in the top picture, and then he would snap it out, to make the crack noise.  I also noticed that there was incense burning.

I imagine this is some sort of religious or remembrance ceremony, but it’s definitely one of the most bizarre things I’ve seen during my stay in Singapore.  Perhaps someone can shed some light on exactly what’s going on here?  I didn’t want to disturb them, as it might have been improper and rude.