Skip to content

Instantly share code, notes, and snippets.

View NateFuller's full-sized avatar

Nathan Fuller NateFuller

  • SimpliSafe
  • Somerville, MA
  • 20:32 (UTC -04:00)
View GitHub Profile
import Foundation
class Debouncer {
/**
Create a new Debouncer instance with the provided time interval.
- parameter timeInterval: The time interval of the debounce window.
*/
init(timeInterval: TimeInterval) {
-- set image to POSIX file "/Users/arthur/Pictures/Wallpaper/Afternoon.jpg"
on idle
set t1 to (time of (current date))
if (t1 > 0 and t1 < 10800) then
set image to POSIX file {"/Users/Pictures/Wallpaper/Night.jpg"}
else if (t1 > 10800 and t1 < 21600) then
set image to POSIX file {"/Users/Pictures/Wallpaper/LateNight.jpg"}
else if (t1 > 21600 and t1 < 28800) then
set image to POSIX file {"/Users/Pictures/Wallpaper/EarlyMorn.jpg"}