We count the number of lattice paths lying under a cyclically shifting piecewise linear boundary of varying slope. Our main result can be viewed as an extension of well-known enumerative formulae concerning lattice paths dominated by lines of integer slope (e.g. the generalized ballot theorem). Its proof is bijective, involving a classical "reflection" argument. Moreover, a straightforward refinement of our bijection allows for the counting of paths with a specified number of corners. We also show how the result can be applied to give elegant derivations for the number of lattice walks under certain periodic boundaries. In particular, we recover known expressions concerning paths dominated by a line of half-integer slope, and some new and old formulae for paths lying under special "staircases."