Skip to content

Instantly share code, notes, and snippets.

View ihordiachenko's full-sized avatar

Ihor Diachenko ihordiachenko

View GitHub Profile
@ihordiachenko
ihordiachenko / README.md
Last active November 7, 2023 08:39
Readme template

Backend Service Name

Add a brief description or introduction of your backend service. List the primary responsibilities and features. Give some context on how this service fits in the overall system.

Getting Started

Instructions on how to get your project up and running locally.

Prerequisites

@ihordiachenko
ihordiachenko / dinic_max_flow.js
Created July 20, 2020 22:51
Dinic's max flow algorithm implementation
class Graph {
constructor(verticies, edges) {
this.verticies = verticies
this.adj = new Array(verticies)
for (let i = 0; i < verticies; i++) {
this.adj[i] = []
}
edges.forEach(edge => {
const forward = {v: edge.to, capacity: edge.weight, flow: 0}
class MaxHeap {
constructor (arr) {
this.heap = arr
for (let i = Math.round(this.heap.length/2); i >= 0; i--) {
this.heapify(i)
}
}
heapify(i) {
<template>
<div>
<div
ref="raw"
v-show="false"
>
<mjml>
<mj-body>
<mj-text
padding="0 0 16px"
@ihordiachenko
ihordiachenko / http_version.sh
Created March 3, 2020 09:57
Check HTTP version of an endpoint
curl -sI https://curl.haxx.se -o/dev/null -w '%{http_version}\n'
@ihordiachenko
ihordiachenko / http_version.sh
Created March 3, 2020 09:57
Check HTTP version of an endpoint
curl -sI https://curl.haxx.se -o/dev/null -w '%{http_version}\n'
@ihordiachenko
ihordiachenko / prune.sh
Created August 24, 2018 12:36
Prune unused git branches
git remote prune origin
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
@ihordiachenko
ihordiachenko / suicide_bomber.sol
Created April 19, 2018 12:55
Force ether to a contract
pragma solidity ^0.4.21;
/**
* This contract allows to force Ether into a contract.
*/
contract SucideBomber {
function SucideBomber() payable {}
function boom(address target) public {
selfdestruct(target);
describe('init', function() {
beforeEach(function() {
ctrl.statistics = undefined;
sinon.stub(ctrl.statisticsService, 'getRangeVerbose');
sinon.stub(ctrl, 'initRangePicker');
sinon.stub(ctrl, 'watchFilters');
sinon.stub(ctrl, 'pick');
sinon.stub(ctrl, 'getFilters');
});
xcode-select --install