connect speaker and guitar to macbook with only one 3.5 mm jack I want to connect eletro acoustic guitar and a speaker too to my Macbook.

My Macbook has only one 3.5 mm jack and for connecting 2 devices simultaneously I need to have two 3.5 mm jacks. Is there any way to connect both devices?
Try this from Griffin Technology.  I've never used it myself.