Skip to content

Instantly share code, notes, and snippets.

@hcodes
hcodes / videoevents.js
Created June 16, 2023 07:45
log videoevents
function logVideoEvents(video) {
[
'canplay',
'canplaythrough',
'durationchange',
'ended',
'loadeddata',
'loadedmetadata',
'pause',
'play',
'use strict';
const errorCodes = [
{
title: 'Typos',
code: 1
},
{
title: 'Repeat words',
code: 2
<script src="./jquery.js"></script>
<script src="./typograf.js"></script>
<script>
var tp = new Typograf({locale: ['ru', 'en-US']});
$(document).ready(function() {
$('p').each(function() {
var elem = $(this);
elem.html(tp.execute(elem.html()));
})
});
@hcodes
hcodes / metrika-errors.js
Last active May 30, 2019 12:48
Отслеживание js-ошибок с помощью Метрики
window.onerror = function(msg, file, line, col, err) {
if (!window.JSON) {
return;
}
var counterId = 12345,
siteInfo = {},
pointer = siteInfo;
path = [
'JS errors',