Skip to content

Instantly share code, notes, and snippets.


Denis Kyashif deniskyashif

View GitHub Profile
View recursive-descent.js
S -> aAe
A -> bAd | c
const parse = (() => {
let tokens;
let pos = 0;
const peek = () => tokens[pos];
const eat = token => {
deniskyashif / pre-commit-dotnet-format
Last active September 30, 2021 08:01
Git pre-commit hook to run dotnet format on the staged files.
View pre-commit-dotnet-format
cs_files="$(git diff --name-only --cached --diff-filter=d | grep -E '\.cs$')"
if [ -n "$cs_files" ]; then
cs_files_seperated_by_comma="$(echo $cs_files | tr ' ' ,)"
dotnet format --workspace <Project-Root> --files $cs_files_seperated_by_comma
git add $cs_files
deniskyashif / req-lca.cs
Last active July 2, 2019 05:56
Solution for Range Minimum Query & Lowest Common Ancestor
View req-lca.cs
Solves both Range Minimum Query & Lowest Common Ancestor
in O(n) space & O(1) query time following Farach-Colton and Bender's algorithm.
using System.Collections.Generic;
using System.Linq;
public class RMQLin
deniskyashif / rsq-st.cs
Created June 28, 2019 12:02
Range Sum Query in Linear Time
View rsq-st.cs
public class RSQLog
private int[] A;
private int[,] sparseTable;
private int[] logTable;
public RSQLog(int[] A)
deniskyashif / rmq-st.cs
Last active June 28, 2019 12:05
Implementation of Range Minimum Query with Sparse Table.
View rmq-st.cs
public class RMQLog
private int[] A;
private int[,] sparseTable;
private int[] logTable;
public RMQLog(int[] A)

This is the readme for the UDM Project


This is the project used for the Global Domain entities


This is the project for the SQL Server Integration Services used to populate the PostgreSQL database

View has-children.js
// hard-code that the item will always have children
hasChildren: true
// map the hasChildren property to the hasSubordinates field, serialized from the server
hasChildren: "hasSubordinates"
// compute whether the given item will have children
hasChildren: function(item) {
return item.hasEmployees && item.relatedDepartment;
View LevenshteinDistance.cs
public static class Distance
public static double Levenshtein(string source, string target)
if (source.Length == 0)
return target.Length;
if (target.Length == 0)
return source.Length;
View rewrite-functions.js
The problem: define functions range, map, reverse and foreach, obeying the restrictions below, such that the following program works properly.
It prints the squares of numbers from 1 to 10, in reverse order.
You must not use arrays. The square bracket characters, [ and ], are forbidden, as well as new Array.
You must not use objects. The curly braces, { and }, and the dot character (.) are forbidden. You may use curly braces for code blocks, but not for creating JavaScript objects.
Should go without saying, these functions must be generic and do what their name implies. They must not be hard-coded for the particular 1..10 example.