Skip to content

Instantly share code, notes, and snippets.

View zaxoavoki's full-sized avatar
🇺🇦

Volodymyr Zakhovaiko zaxoavoki

🇺🇦
View GitHub Profile
@zaxoavoki
zaxoavoki / sortGraphqlSchema.js
Created October 11, 2022 08:17
Sort GraphQL schema alphabetically
const match = `<insert GraphQL schema here>`.match(/(^[^\t].+\n|})|(\t.+)/gm);
let lines = [], tmp = [];
for (const mat of match) {
if (mat.startsWith('\t')) {
tmp.push(mat + '\n');
} else {
lines = [...lines, ...tmp.sort()];
tmp = [];
lines.push(mat);
@zaxoavoki
zaxoavoki / JSOS.md
Last active January 4, 2022 12:56
Średnia ocena wszystkich kursów

Count your average courses mark

  1. Open JSOS website and go to the "Indeks" page https://jsos.pwr.edu.pl/index.php/student/indeksOceny/oceny/1.
  2. Click "Pobierz więcej..."
  3. Open Developer Console and insert this script:
const [sumMark, ects] = [...document.getElementsByTagName('tr')]
  .filter(e => e.classList.contains('data'))
 .map(e =&gt; [parseInt(e.children[7].innerHTML), parseFloat(e.children[5].innerHTML) || 3])
@zaxoavoki
zaxoavoki / README.md
Last active April 27, 2021 07:56
Ticker - letter's appearing with delay

Ticker - letter's appearing with delay

Promise-based implementation of ticker

@zaxoavoki
zaxoavoki / README.md
Last active December 16, 2020 13:35
Fill array in spiral pattern

Fill array in spiral pattern

@zaxoavoki
zaxoavoki / GUI.form
Last active March 31, 2020 14:02
Calculator on Java with GUI
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="GUI">
<grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="11" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="20" y="20" width="348" height="572"/>
</constraints>
<properties/>
<border type="none" title=""/>
<children>
@zaxoavoki
zaxoavoki / new_year.py
Created December 29, 2019 09:55
Happy New Year animation with Python3
from os import system
from time import sleep
string = [
"| | | | | _ | | _ | | _ | | | | | | \\ | | | __ | \\ \\ / / | | | | | __ | | _ | | __ | ",
"| |_| | | |_| | | __| | __| \\ ` / | |\\ | | | ___| \\ \\ _ / / \\ ` / | ___| | |_| | | ___/ ",
"| _ | | _ | | | | | | | | | \\ | | |_ \\ \\/_\\/ / | | | |_ | _ | | |\\ \\ ",
"|_| |_| |_| |_| |_| |_| |_| |_| \\ | |___| \\_/ \\_/ |_| |___| |_| |_| |_| \\_\\ "]
@zaxoavoki
zaxoavoki / README.md
Created April 20, 2019 16:30
Disk Scheduling Algorithms

Disk scheduling algorithms

FCFS

FCFS is the simplest of all the Disk Scheduling Algorithms. In FCFS, the requests are addressed in the order they arrive in the disk queue.

Advantages:

  • Every request gets a fair chance
@zaxoavoki
zaxoavoki / README.md
Created April 18, 2019 19:20
Page Replacement Algorithms

Page Replacement Algorithms

FIFO

First In First Out is the simplest page replacement algorithm. In this algorithm, the operating system keeps track of all pages in the memory in a queue, the oldest page is in the front of the queue. When a page needs to be replaced page in the front of the queue is selected for removal.

OPT

In Optimal Page replacement algorithm pages are replaced which would not be used for the longest duration of time in the future.

@zaxoavoki
zaxoavoki / README.md
Created December 28, 2018 17:34
Visualizationof PI number.
Visualization of PI number.

Copy pi.txt file with first 4 billion numbers of PI from here. Change size of cell for different scale of window and run a program. Also you can change the HEX color for each number (0-9) to see different variants of visualization.

Example :)

Image