<commit_before>setHeartbeat = (err, res) ->
  Session.setTemp 'serverTime', res if not error?

Meteor.startup ->
  $(window).resize ->
    Session.set 'resize', new Date()

@fixNav = ->
  $('body').css 'margin-top', "#{$('.navbar-fixed-top').outerHeight(true)}px"

@resizeThumbnails = (template) ->
  template.$('a.thumbnail img').height template.$('a.thumbnail').first().width() / 16 * 9 + 'px'

@resizePanelTitle = (template) ->
  title = template.$ '.panel-title'
  span = title.find '[data-toggle="tooltip"]'
  Meteor.setTimeout ->
    span.width 'initial'
    if span.width() > title.width()
      span.width '100%'
    span.tooltip 'fixTitle'
  , 50

# call once straight away and every 10 seconds thereafter
Meteor.call 'getServerTime', setHeartbeat
@heartbeatInterval = Meteor.setInterval ->
  Meteor.call 'getServerTime', setHeartbeat
, 10000

Template.registerHelper 'roomOffline', ->
  data = Template.currentData()
  offline = data.offline
  if offline
    heartbeat = data.heartbeat
    now = Session.get 'serverTime'
    lastUpdate = now - heartbeat
    lastUpdateTime = moment.unix heartbeat
    whenAgo = lastUpdateTime.fromNow true
    whenTime = lastUpdateTime.format 'dddd, MMMM Do YYYY, HH:mm:ss'
    {ago: whenAgo, time: whenTime}<commit_msg>Tidy up - reduce line length.<commit_after>setHeartbeat = (err, res) ->
  Session.setTemp 'serverTime', res if not error?

Meteor.startup ->
  $(window).resize ->
    Session.set 'resize', new Date()

@fixNav = ->
  $('body').css 'margin-top', "#{$('.navbar-fixed-top').outerHeight(true)}px"

@resizeThumbnails = (template) ->
  template.$('a.thumbnail img').height(
    template.$('a.thumbnail').first().width() / 16 * 9 + 'px'
  )

@resizePanelTitle = (template) ->
  title = template.$ '.panel-title'
  span = title.find '[data-toggle="tooltip"]'
  Meteor.setTimeout ->
    span.width 'initial'
    if span.width() > title.width()
      span.width '100%'
    span.tooltip 'fixTitle'
  , 50

# call once straight away and every 10 seconds thereafter
Meteor.call 'getServerTime', setHeartbeat
@heartbeatInterval = Meteor.setInterval ->
  Meteor.call 'getServerTime', setHeartbeat
, 10000

Template.registerHelper 'roomOffline', ->
  data = Template.currentData()
  offline = data.offline
  if offline
    heartbeat = data.heartbeat
    now = Session.get 'serverTime'
    lastUpdate = now - heartbeat
    lastUpdateTime = moment.unix heartbeat
    whenAgo = lastUpdateTime.fromNow true
    whenTime = lastUpdateTime.format 'dddd, MMMM Do YYYY, HH:mm:ss'
    {ago: whenAgo, time: whenTime}
{'fraction_non_alphanumeric': 0.14817718541748334, 'fraction_numerical': 0.011760094080752646, 'mean_word_length': 3.806026365348399, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '3552387', 'n_tokens_mistral': 885, 'n_tokens_neox': 827, 'n_words': 197}