Line through the hole, tie square knot in the end of the line. Then tie a figure eight around the sail corner. Square knot keeps the figure eight from slipping and the whole arrangement is very low profile taking up very little length. If hoist height is not a problem, bowlines are the way to go.
For sheets, they're usually sized large enough that you can put them through the hole and simply tie a figure eight stopper in the end of it to keep it from pulling back through. Again, low profile is key to keep them from snagging the forestay and such during gybes.