Skip to content

Instantly share code, notes, and snippets.

View dcsaszar's full-sized avatar

David Császár dcsaszar

  • JustRelate Group
View GitHub Profile
@dcsaszar
dcsaszar / index.js (of your test app)
Last active November 12, 2018 14:27
index.js of your test app
console.log("Hello")
ment.style {
padding: 0.5em 1em 0.3em;
font-size: 100%;
font-weight: bold;
color: #444;
opacity: 0.8;
background: #ccc;
display: block;
scrivito.on 'content', (content) ->
if scrivito.in_editable_view()
$(content).find('''
[data-scrivito-field-type=stringlist]:not([data-editor]),
[data-editor~=stringlist]
''').each -> # ...
scrivito.define_editor "stringlist",
can_edit: (dom_element) -> $(dom_element).data("scrivito-field-type") == "stringlist"
edit: (dom_element) -> # ...
DATE_REGEX = /at\s(?<date>20\d\d-\d\d-\d\d\s)\d\d:\d\d:\d\d/
MS_REGEX = /Obj Load \((?<ms>.*?)ms\)\s+(?<q>.*)/
ms_by_query = Hash.new { |hash, key| hash[key] = [] }
ms_by_date = Hash.new { |hash, key| hash[key] = [] }
histogram_ms = Hash.new { |hash, key| hash[key] = 0 }
date = nil
IO.foreach("log/development.log") do |line|
line = line.force_encoding('ISO-8859-1')