How does an open-collector gate work by using resistors?
Open-drain (or open-collector, in the case of BJT's) inputs allow the connecting of more than one output to the same line. This is called a wired-OR. The line is tied high with a pull-up resistor.

This is why pins such as reset and interrupt lines on a microcontroller, among others, are all "active low" - meaning when they are not asserted (logic 1) they are in a high-impedance state, effectively disconnecting the pin from the line. Since none of the output lines are then driving the line, a pull-up resistor is necessary to keep the line going into the microcontroller in a high, or logic 1 state.  Then any of the devices can pull the line low  (logic 0) without affecting the other devices.  (If one device actively pulled the line high, and another device actively pulled the line low, you'd have a  short.)

Such inputs are usually designated as active-low with a bar across the top of the signal name (\$\small \overline{\text{INT}}\$).  On systems where that is not possible, other methods are to use a leading exclamation point (!INT), or a leading slash (/INT), or a trailing # sign (INT#).  In the Eagle schematic capture program, if you prefix a symbol with ! the program will turn it into an overbar.



In the circuit above, there are three devices that are capable of generating an interrupt.  When none of the interrupts are active (logic 0), all the outputs are in a high-impedance state and the high voltage (VCC) is supplied to the input of the microcontroller on the right by the pull-up resistor R1.  When one of the interrupt lines is asserted, it drives the output low (logic 0), which feeds into the active low interrupt pin of the microcontroller and generates an interrupt.

If the microcontroller needs to determine source of the interrupt, the outputs can be isolated with diodes as shown below, and each one brought back to an individual pin on the microcontroller.  (the other way, which saves using the extra pins on the microcontroller, is for it to pull the registers of each device.)



Pull-up resistors are also used on I2C lines, as shown below:



One of the "nodes" is typically a microcontroller, with the other nodes being devices.  However they all use essentially the same circuitry.  I2C allows more than one master (e.g. microcontroller) to be connected to the same bus (multi-master mode).

The pull-ups are required because both the clock lead (SCL) and data lead (SDA) are bi-directional, so you have more than one device capable of driving the same line.  (SCL because of clock stretching by the slave, and SDA because the same line is used for input and output.)

When no device is driving the SCL or SDA lines, all MOSFETs are off.  When one of the devices is asserting  line, one of the MOSFETs is on, driving the line low.