Skip to content

Instantly share code, notes, and snippets.

View tarik02's full-sized avatar
๐Ÿ‰
Based

Taras tarik02

๐Ÿ‰
Based
View GitHub Profile
#!/usr/bin/env bash
set -Eeuo pipefail
# -c, --context string context in the kubeconfig file of the PVC
# -k, --kubeconfig string path of the kubeconfig file of the PVC
# -R, --mount-read-only mount the PVC in ReadOnly mode (default false)
# -n, --namespace string namespace of the PVC
# -d, --dir string dir to mount to (defaults to /mnt)
@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;