Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tarik02's full-sized avatar
🍉
Based

Taras tarik02

🍉
Based
View GitHub Profile
@tarik02
tarik02 / download-math-moodle.js
Last active October 5, 2020 16:00
download-math-moodle.js
// copy(JSON.stringify([...$('.topics .section:not(:first-child) .content .section .activityinstance>a')].map(it => ({ name: it.innerText + '.doc', href: it.href }))))
const data = [{ "name": "Лекція 1.1. Визначники. Основні поняття, властивості, обчислення визначників.,\nФайл.doc", "href": "http://mdl.lntu.edu.ua/mod/resource/view.php?id=15192" }, { "name": "Самостійна робота.1.1 Визначники.\nФайл.doc", "href": "http://mdl.lntu.edu.ua/mod/resource/view.php?id=15193" }, { "name": "Лекція 2.1. Матриці. Основні поняття, властивості, дії над матрицями.\nФайл.doc", "href": "http://mdl.lntu.edu.ua/mod/resource/view.php?id=15194" }, { "name": "Лекція 2.2. Обернена матриця. Ранг матриці.\nФайл.doc", "href": "http://mdl.lntu.edu.ua/mod/resource/view.php?id=15195" }, { "name": "Самостійна робота 2.1. Матриці.\nФайл.doc", "href": "http://mdl.lntu.edu.ua/mod/resource/view.php?id=15196" }, { "name": "Лекція 3.1. Системи лінійних алгебраїчних рівнянь.\nФайл.doc", "href": "http://mdl.lntu.edu.ua/mod/resource/view.php?id=1
import sys
from functools import reduce
N = 4
VARS = 'abcd'
mult = lambda a, b: a * b
def showN(i):
if i == 1:
@tarik02
tarik02 / love
Created August 6, 2019 19:23
wsl polyfills
#!/bin/bash
if (( $# > 0 )); then
lovec.exe "$@"
else
lovec.exe .
fi
@tarik02
tarik02 / main.c
Created May 26, 2019 09:13
Repack cossacks resources.gsc (all.gsc) from Russian to English version.
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#define INPUT_KEY 0x4EBA // Input key (Russian)
#define OUTPUT_KEY 0x78CD // Output key (English)
#define CHUNK_SIZE 1024 * 1024 // 1MB
int main(int argc, char *argv[]) {
function intersect(r1, r2) {
if (r2.p1.x > r1.p2.x
|| r2.p2.x < r1.p1.x
|| r2.p1.y > r1.p2.y
|| r2.p2.y < r1.p1.y) {
return null;
}
return {
//-------------------------------BEGIN CONFIG-------------------------------//
//#ifdef LOCAL
#define IO_FILES
//#else
//#define IO_STD
//#endif
//#define IO_INPUT_NAME "input.txt"
//#define IO_OUTPUT_NAME "output.txt"
#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
ifstream in("input.txt");
ofstream out("output.txt");
int main() {
ull n;
in >> n;