You need to recognize burst gankers like Tiny are a threat early in the game and adjust your play around them. Typically, this means that I'll be picking up strength Power Treads and/or a Bracer to give myself extra strength to survive. If the other team has multiple magic damage heroes, you can also look into picking up a Cloak or even a Hood or Pipe.
This should prevent Tiny (or Nerubian Assassin, or a few others when they're ported) from ganking you by himself, he'll need teammates or a truly massive advantage to do so. Tiny has powerful burst but after his combo (which deals ~900 magic damage, ~675 damage to standard magic resistance) plus the damage from a couple of autoattacks, if he hasn't killed you there's no way he should be able to: you have your own spells and hopefully aware teammates.
Other things you can do to prevent a Tiny from snowballing apply to every game: have good wards up at all times and help your middle lane rune control if possible. Limiting Tiny's early game mana really slows him down because he's not much of a threat without that 240 mana to combo. You can also put strong laners against him, since Tiny has such low base armor, and seriously limit his early game farm. Some common options to counter a solo melee hero in mid lane include:
- Ancient Apparition
- Batrider
- Viper
- Venomancer
- Warlock
- Lich
Anti-Mage is a strong carry and Shadow Shaman a strong disabler/pusher. I assume the two of them are laning together, but if not the same will still somewhat apply. Trying to outcarry Anti-Mage usually isn't a very good prospect. If you're really determined to try to do that, Riki and Slardar are your best options.
Otherwise, you need to have someone strong to harass Anti-Mage when he's at his weakest and slow down his farm. If he's allowed to farm easily for 10-15 minutes he's incredibly harder to deal with in teamfights. You can't expect to kill him, however: blink is too good of an ability. Instead, you want someone who's not going to be threatened by him much in lane.
Shadow Shaman is not a very good babysitter because he needs early levels. His autoattack range, damage, and armor are all low, and so he is easily outclassed by an enemy harasser. Once Shadow Shaman is more subdued, you can turn to keeping the Anti-Mage from getting easy farm.
I recommend Lich or Venomancer for this purpose, but you'll need a lane partner with a stun as well to prevent Shadow Shaman from just gripping you. Anyone with a stun will do, but I'm not sure if the bots will be smart enough to use their stun as an interrupt. (At this point I should mention that you guys should be laning against each other if you're going 2v2 with 3 bots per team, otherwise you're just seeing who's better at taking advantage of dumb bots.) Other heroes like Shadow Demon, Obsidian Destroyer, and Bane can be useful counters to Anti-Mage at various stages of the game because of their spells, while heroes like Leshrac and Death Prophet can push towers and make it more difficult for Anti-Mage to farm.
Countering Rhasta (Shadow Shaman) is a lot more simple. You just need to be coordinated to quickly stop his Shackle, and don't be out of position enough to be Hexed. If you get ward-trapped, either use Phase Boots to walk out or kill one of the edge (not corner) wards and then walk free.
Ghost Scepter and Force Staff deserve special notice as great item pickups against both of these heroes. Shadow Shaman's wards won't be a threat and Anti-Mage can't stay on you (but be wary of his allowing his ultimate to do extra damage with Ghost Scepter). Force Staff also helps save teammates (Force Staff them away from the Anti-Mage, forcing him to commit more heavily for a kill attempt).
tl;dr: Lane Lich and a stunner against the AM. Get pushing power elsewhere. Deny him farm, use Frost Armor/Force Staff/Ghost Scepter in midgame to prevent him from killing people quickly with melee attacks. Push heavily during this time to earn a gold lead and hopefully take a set of Barracks quickly. You don't want to go lategame against an Anti-Mage without a similarly powerful carry like Riki/Slardar/Faceless Void.
Best Answer
Any hero that uses a diffusal blade well (i.e. Phantom Lancer, Mirana, Riki) will do relatively well against Warlock. Even then, DoTA is not a game of true "hard-counters", and well played Warlocks will beat not so well played Warlock counters. Warlock is a strong hero (and has high public win percentage) but is essentially ignored by almost every competitive team at the moment (the notable exception being Cloud9 using it as a 4-role). There are a few reasons for this. The hero has a good attack animation/damage early but is easy to gank and does not gank well without his ultimate. Moreover, his most useful team fighting skill (upheaval) is not useful in lane and his most useful laning skill (shadow word) is not useful in team fights. This makes him awkward to skill as a solo and very level dependent (i.e. the above mentioned 4 warlock builds Hand of Midas). This means that under the current metagame, it really does not have the ability to be a competitively viable 2 or a 3 (solo laner), and is quite level/item dependent to be a 4/5 (a support).
In solo lanes, there are not too many matchups that warlock has trouble with. Razor can give you fits as you are slow and really do not have an effective way to stop leeching damage. Heroes with long range harassing abilities can be a problem if they have high ground advantage. The hero does well in 1v1's against essentially all melees.
Generally speaking there are not any heroes that make Warlock look really silly, though this is true of most heroes. The way to get an advantage against such a hero is to gank early, and take team fights in between his long ult cooldown. As a Warlock, you need to take objectives/big team fights with your ult and upheaval.