Skip to content

Instantly share code, notes, and snippets.

View kolyaflash's full-sized avatar

Nikolay Baluk kolyaflash

  • Cisco
View GitHub Profile
@kolyaflash
kolyaflash / PD-1_wer_log_prob.csv
Last active October 30, 2023 20:04
PD-1_wer_log_prob.csv
wer log_prob tokens_num char_num total_length
13.333333333333334 -2.901705503463745 22 68 640
27.272727272727273 -9.383849143981934 34 78 576
0.0 -5.348936080932617 39 110 576
18.75 -7.895171165466309 37 79 640
17.647058823529413 -6.874451637268066 42 95 704
25.0 -10.254037857055664 38 81 640
12.5 -6.627464294433594 34 83 704
14.285714285714286 -6.779921054840088 31 84 704
12.5 -6.765547275543213 32 83 704
@kolyaflash
kolyaflash / jsonrpc.py
Last active May 11, 2022 09:37
Tryton 4 JSON-RPC example
import requests
import json
import base64
HOST = '127.0.0.1'
PORT = '8001'
CREDENTIALS = ('admin', 'admin') # login, password
class HttpClient:
@kolyaflash
kolyaflash / iScroll and Infinite Scroll together
Created October 28, 2014 15:37
iScroll and Infinite Scroll play together when you don't want to change infinitescroll side.
function loaded () {
myScroll = new IScroll('#wrapper', {
scrollX: true, scrollY: false, mouseWheel: true, wheelHorizontal: true,
//snap: 'li',
click: false,
scrollbars: true,
hideScrollbar:false,
});
var infinitescrollElement = $('.all2cart-products_grid');
'use strict';
/*
Vanilla js here
*/
var urlParams;
(window.onpopstate = function () {
var match,
//--- app.js
function uuid() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x7|0x8)).toString(16);
});
return uuid;