Skip to content

Instantly share code, notes, and snippets.

View istudyatuni's full-sized avatar
💭
Hey

Ilia istudyatuni

💭
Hey
View GitHub Profile
@istudyatuni
istudyatuni / unobtrusive-deepl-ublock-filters.txt
Last active April 17, 2022 11:44
Unobtrusive DeepL uBlock Origin filters
[uBO 1.42.0]
! Title: Unobtrusive DeepL
! Homepage: https://gist.github.com/istudyatuni/96f0cc687e89b44208bed33c633564f7
! Direct link: https://gist.githubusercontent.com/istudyatuni/96f0cc687e89b44208bed33c633564f7/raw/unobtrusive-deepl-ublock-filters.txt
www.deepl.com##footer
www.deepl.com###dl_quotes_container
www.deepl.com###dl_cookieBanner
www.deepl.com##.dl_visible_desktop_only
www.deepl.com##.dl_visible_handheld_only
@istudyatuni
istudyatuni / download-blob.js
Created January 26, 2022 17:06
Download blob as file
const response = await fetch('/url')
const blob = await response.blob()
const a = document.createElement('a')
a.setAttribute('download', 'your-file.extension')
a.href = URL.createObjectURL(blob)
a.click()
@istudyatuni
istudyatuni / boxberry-track.py
Last active November 22, 2021 13:58
Track changing boxberry status without needing reload page
import os
import requests
import time
sid = ''
url = f'https://boxberry.ru/api/v1/tracking/order/get?searchId={sid}'
headers = {
'user-agent': 'Mozilla/5.0'
}
@istudyatuni
istudyatuni / example.js
Created June 13, 2021 11:09
Load module to Dev Tools
let module
import('/path/to/module.js').then(m => module = m)
let timerID = 0
let ws = new WebSocket(url)
ws.onopen = () => {
// some code
keepAlive()
}
ws.onclose = () => {
// some code
cancelKeepAlive()
}
@istudyatuni
istudyatuni / svg.html
Last active March 10, 2023 08:43
Крестик
<!-- крестик -->
<svg aria-hidden="true" class="svg-icon" width="18" height="18" viewBox="0 0 18 18"><path d="M15 4.41L13.59 3 9 7.59 4.41 3 3 4.41 7.59 9 3 13.59 4.41 15 9 10.41 13.59 15 15 13.59 10.41 9 15 4.41z"></path></svg>
<!-- or multiplication sign-->
<span>×</span>
:root {
--text-color: #434343;
--border-color: #CDA6FC;
--main-bg-color: #fff;
--action-bg-color: #F0EEEE;
--hover-bg-color: #f0eeee;
}
.dark-mode {
--text-color: #F8F8F8;
@istudyatuni
istudyatuni / message-colors.css
Last active October 19, 2020 07:58
Color scheme for info, success, warn and error messages
/* Colors */
.error {
background-color: #FFBABA;
color: #D8000C;
}
.error:hover {
background-color: #FFA4A4;
}
@istudyatuni
istudyatuni / delay.ts
Last active October 19, 2020 08:07
Delay in TypeScript
function delay(ms: number) {
return new Promise( resolve => setTimeout(resolve, ms) );
}
// call inside async function
await delay(300);
// not in async function
(async () => {
await delay(1000);