Skip to content

Instantly share code, notes, and snippets.

View ihordiachenko's full-sized avatar

Ihor Diachenko ihordiachenko

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<Hotel> <!-- (1) WRONG ROOT NAME: should be <Hotels> -->
<Hotel Rating="4.2">
<Name>Westin</Name>
<Phone>480-968-8885</Phone>
<Phone>800-937-8461</Phone>
<Address NearestAirport="Sky Harbor">
<Number>11</Number>
<Street>E 7th St</Street>
<City>Tempe</City>
<?xml version="1.0" encoding="utf-8"?>
<Hotels>
<Hotel Rating="4.2">
<Name>Westin</Name>
<Phone>480-968-8885</Phone>
<Phone>800-937-8461</Phone>
<Address NearestAirport="Sky Harbor">
<Number>11</Number>
<Street>E 7th St</Street>
<City>Tempe</City>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<!-- Root: Hotels -->
<xs:element name="Hotels">
<xs:complexType>
<xs:sequence>
<xs:element name="Hotel" maxOccurs="unbounded">
@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