Skip to content

Instantly share code, notes, and snippets.

View br4instormer's full-sized avatar

br4instormer br4instormer

View GitHub Profile
@br4instormer
br4instormer / settings.json
Created April 21, 2024 12:47
Pylance project config to work with virtualenv
{
"python.analysis.extraPaths": [
"venv/lib/python3.12/site-packages"
],
"python.defaultInterpreterPath": "${workspaceFolder}/venv/bin/python"
}
@br4instormer
br4instormer / default.conf
Last active September 21, 2024 16:03
Nginx rewrite rule. Redirect with no query if querystring is matched
server {
# replace query string is query fits
if ($request_uri ~ "limit=24&start=0") {
rewrite ^(.*) $1? permanent;
}
}

Рандомизатор текста по шаблону на JavaScript

Реализация задачи с fl.ru. Заказчик выбрал другого исполнителя.

Нужно написать функцию на JS, которая на входе будет получать текстовую переменную:

{Привет|Здравствуй|Хай}! У тебя есть {3|5|10|20} попыток, что бы {правильно ответить|угадать ответ} на вопрос.

А на выходе сгенерированный текст типа:

@br4instormer
br4instormer / debounce.js
Created February 23, 2023 21:06
Javascript debounce oneliner
export default (callback, time = 250, interval) =>
(...args) =>
clearTimeout(interval, interval = setTimeout(callback, time, ...args))
@br4instormer
br4instormer / user-script.js
Last active October 6, 2024 11:13
ozon-wait-and-order
// ==UserScript==
// @name ozon-wait-and-order
// @namespace http://ozon.ru
// @version 0.2
// @description wait for discount and order
// @author br4instormer
// @match https://www.ozon.ru/product/*
// @match https://www.ozon.ru/cart*
// @match https://www.ozon.ru/gocheckout*
// @icon https://www.ozon.ru/public/favicon.ico
@br4instormer
br4instormer / wildberries-walk-and-order.js
Last active September 21, 2024 16:08
Wildberries out and about script
// ==UserScript==
// @name wildberries-search-and-add-to-cart2
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Depicting a flurry of activity
// @author br4instormer
// @match https://wildberries.ru/*
// @match https://www.wildberries.ru/*
// @icon https://www.wildberries.ru/favicon.ico
// @grant none
@br4instormer
br4instormer / Dockerfile
Last active January 15, 2023 09:15
nginx docker image with enabled autoindex
FROM nginx:latest
RUN sed -i '/index index.html index.htm;/a \\n\
autoindex on;\n\
autoindex_exact_size off;\n\
autoindex_format html;\n\
autoindex_localtime on;' /etc/nginx/conf.d/default.conf