<commit_before>get_time_to_sunrise = ->
  time_now = moment().startOf('day')
  sunrise = new Sunrise(time_now).get()
  sunrise = new Sunrise(time_now.add('days', 1)).get() if moment().isAfter(sunrise)
  sunrise.diff(moment(), 'seconds')

$ ->  $('.countdown-to-sunrise').FlipClock get_time_to_sunrise(), countdown:true
<commit_msg>fixes #13 by making sunrise countdown clock re-synch every 30 seconds<commit_after>get_time_to_sunrise = ->
  time_now = moment().startOf('day')
  sunrise = new Sunrise(time_now).get()
  sunrise = new Sunrise(time_now.add('days', 1)).get() if moment().isAfter(sunrise)
  sunrise.diff(moment(), 'seconds')

set_countdown_clock_repeatedly = (clock) ->
  clock.setTime(get_time_to_sunrise())
  setTimeout((-> set_countdown_clock_repeatedly(clock)), 3e+4)

$ -> set_countdown_clock_repeatedly($('.countdown-to-sunrise').FlipClock get_time_to_sunrise(), countdown:true)

{'fraction_non_alphanumeric': 0.16294642857142858, 'fraction_numerical': 0.008928571428571428, 'mean_word_length': 6.53781512605042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4787740', 'n_tokens_mistral': 330, 'n_tokens_neox': 324, 'n_words': 50}