A lot of these schools are free to attend but take a percentage of your salary once you find a job upon completion.
Hacker School doesn't take a segment of your earnings either. They try to get you a job at then end they take a recruiting commission from whoever hires you, but nothing from the student.
In fact, I don't know of a single school that does this. gSchool refunds your tuition if you don't find a job. Flatiron School refunds a portion if you take a job through one of their partners. No one, as far as I know, takes a portion of student's salary beyond the tuition.
Few of these schools are free. Most supplement a course fee with a placement fee they receive by acting as your recruiter.