Use this wiring when the source is at the fixture and you want to control the feed to both components with the same switch. Three-wire cable runs from the fan to the switch box and the source neutral is spliced to the white wire and to the fan neutral.
This is the updated wiring for this arrangement, with a 2-wire cable added between the fan/light and switches. The white wire is no longer used for hot and the source neutral is run through to the switch box to satisfy the 2011 NEC requirement of a neutral wire in all switch boxes. All other wiring is the same as above.
This gfci wiring provides protection to a duplex receptacle. By connecting the load terminals on the last gfci, the receptacle is protected and can be used just as if it were one of the gfci receptacles. One ground fault circuit interrupter at the beginning of the circuit can be used in the same way to protect multiple, subsequent receptacles as illustrated in the diagram below.
This page contains wiring diagrams for ground fault circuit interrupter (gfci) receptacles. Included are diagrams for multiple gfci’s, a protected standard duplex receptacle, and a protected light fixture. Wiring for a switch and gfci receptacle in the same box is also shown to protect the switch and light or to protect other receptacles in the circuit. To wire a gfci circuit breaker see this link and wire a gfci switch combo at this link.