prepare rice by crumbling it with your fingers, breaking up the bigger lumps, and set it aside in a bowl.
heat wok or large, deep skillet over high heat. add oil until it sizzles, and then add garlic and onion and toss well until shiny and fragrant, about 1 minute add shrimp and cook, tossing now and then, until the onion begins to wilt and shrimp are pink and cooked through, 2-3 minute.
add rice, fish sauce, and sugar and toss well. add pineapple and green onion and cook about 2 min more, tossing often, until rice is tender and heated through. serve hot or warm.