{{ message }}

Instantly share code, notes, and snippets.

# Eran Betzalel eranbetzalel

Created Mar 25, 2020
JIRA - Add Issues Sum Row (userscript)
View jira-sum-issue-rows.js
 // ==UserScript== // @name JIRA - Add Issues Sum Row // @namespace http://tampermonkey.net/ // @version 0.1 // @description Calculate the sum row for JIRA issues view // @author You // @match https://*.atlassian.net/issues/* // @grant none // ==/UserScript==
Last active Mar 7, 2016
Implementation of the n-gram algorithm using JavaScript
View ngrams.js
 function ngrams(array, length) { var ngramsArray = []; for (var i = 0; i < array.length - (length - 1); i++) { var subNgramsArray = []; for (var j = 0; j < length; j++) { subNgramsArray.push(array[i + j]) }
Created Apr 14, 2013
Two methods for bytes-decimal conversion.
View DecimalBytesConvertor.cs
 public decimal BytesToDecimal(byte[] buffer, int offset = 0) { var decimalBits = new int[4]; decimalBits[0] = buffer[offset + 0] | (buffer[offset + 1] << 8) | (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24); decimalBits[1] = buffer[offset + 4] | (buffer[offset + 5] << 8) | (buffer[offset + 6] << 16) | (buffer[offset + 7] << 24); decimalBits[2] = buffer[offset + 8] | (buffer[offset + 9] << 8) | (buffer[offset + 10] << 16) | (buffer[offset + 11] << 24); decimalBits[3] = buffer[offset + 12] | (buffer[offset + 13] << 8) | (buffer[offset + 14] << 16) | (buffer[offset + 15] << 24); return new Decimal(decimalBits);
Created Apr 12, 2013
Simple implementation of CSV (or any other character delimited file) writer.
View DelimitedFileWriter.cs
 class Car { public int CarId { get; set; } public DateTime ManufactureDate { get; set; } public decimal SomeDecimal { get; set; } } class DelimitedFileWriterExample { static void Main()