Is it possible to combine languages

Lets say I make a website in html. Can I add a code I wrote in ruby? Likewise, If I write a code in ruby, can I add stuff from php or python?
If so then how?
Thanks in advance for the help!

A google search
== discussions / opinions ==
how to integrate ruby in html
how to integrate python in html

The key is to respect the ‘request/response’ aspect of dynamic document delivery. A request made to a particular environment will be responded to from that environment. CGI, XML, PHP, et al. have all worked together for decades. The resource will contain significant clues as to which environment it expects to be in; the MIME type will determine which engine is used to parse it.