<commit_before>---
---

class Shuffler
  NUM_DIGITS: 13

  constructor: ->
    @start = Date.now()
    @randomNumbers = @generateRandomNumbers(@NUM_DIGITS)
    @meetupDataPromise = @getMeetupData()

  render: ($el) ->
    @$dateMs = $el.find('#dateMs')
    @$dateStr = $el.find('#dateStr')
    @$date = @$dateMs.add(@$dateStr)

    @shuffle()
    @showStartTimeAfterDelay()

  shuffle: ->
    @updateRandomNumbers()
    @shuffleInterval = setInterval(@updateRandomNumbers.bind(@), 5)

  showStartTimeAfterDelay: ->
    # ensure they've seen the animation for a minimum amount of time
    elapsed = Date.now() - @start
    wait = 1500 - elapsed

    if wait < 0
      wait = 0

    setTimeout(@showStartTimeFromMeetup.bind(@), wait)

  getMeetupData: ->
    $.ajax(
      url: 'http://api.meetup.com/2/events'
      cache: true
      dataType: 'jsonp'
      data:
        key: '<KEY>'
        sign: true
        group_urlname: 'hackerhours'
        page: 1
    )

  updateRandomNumbers: ->
    i = Math.floor(Math.random() * @NUM_DIGITS)<commit_msg>simplify JS<commit_after>---
---

class Shuffler
  NUM_DIGITS: 13
  SHUFFLE_TIME: 1500 # ms

  constructor: ->
    @randomNumbers = @generateRandomNumbers(@NUM_DIGITS)
    @meetupDataPromise = @getMeetupData()

  render: ($el) ->
    @$dateMs = $el.find('#dateMs')
    @$dateStr = $el.find('#dateStr')
    @$date = @$dateMs.add(@$dateStr)

    @shuffle()
    @showStartTimeAfterDelay()

  shuffle: ->
    @updateRandomNumbers()
    @shuffleInterval = setInterval(@updateRandomNumbers.bind(@), 5)

  showStartTimeAfterDelay: ->
    setTimeout(@showStartTimeFromMeetup.bind(@), @SHUFFLE_TIME)

  getMeetupData: ->
    $.ajax(
      url: 'http://api.meetup.com/2/events'
      cache: true
      dataType: 'jsonp'
      data:
        key: '<KEY>'
        sign: true
        group_urlname: 'hackerhours'
        page: 1
    )

  updateRandomNumbers: ->
    i = Math.floor(Math.random() * @NUM_DIGITS)
{'fraction_non_alphanumeric': 0.15131240349974268, 'fraction_numerical': 0.010293360782295419, 'mean_word_length': 2.796875, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 17, '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': '7617253', 'n_tokens_mistral': 730, 'n_tokens_neox': 663, 'n_words': 125}