Skip to content

Instantly share code, notes, and snippets.

@TroyKomodo
TroyKomodo / rmq.rs
Last active April 25, 2024 09:33
rmq connection pool
use std::{
sync::{atomic::AtomicUsize, Arc},
time::Duration,
};
use anyhow::{anyhow, Result};
use arc_swap::ArcSwap;
use async_stream::stream;
use futures::{Stream, StreamExt};
use lapin::{
@qfox
qfox / rutube-unsubscribe.js
Created December 24, 2022 16:47
Отписаться (удалить) от всех подписок на rutube (рутуб)
// Нужно открыть devtools в хроме или firefox, и скопировать туда полностью содержание файла
// Вспомогательная пауза для 429
const pause = delay => new Promise(resolve => setTimeout(resolve, delay));
// Забираем список на кого мы подписаны из ручки
const subscriptionReq = await fetch('https://rutube.ru/api/v1/subscription/cards/detail?limit=1000&offset=0', { credentials: 'include' });
const { results } = await subscriptionReq.json();
// Бежим подряд без параллелизма, рутуб всё равно ограничивает кол-во запросов с клиента, поэтому смысла ускорять нет, не даст быстрее
@ark0f
ark0f / bevy_top_left.rs
Last active January 6, 2023 17:54
DOES NOT WARK BECAUSE OF FLICKERING; Top left origin with pixel-perfect scaling in 2D in Bevy
fn setup(mut commands: Commands) {
let mut camera = OrthographicCameraBundle::new_2d();
camera.orthographic_projection.window_origin = WindowOrigin::BottomLeft;
camera.orthographic_projection.scaling_mode = ScalingMode::WindowSize;
commands.spawn(camera);
}
fn top_left_origin(
windows: Res<Windows>,
@superbrothers
superbrothers / kubectl-delete_all
Last active May 22, 2024 19:07
Kubernetes: Delete all objects in the namespace
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
@ezhov-da
ezhov-da / windows-Запрещенные символы.txt
Last active January 13, 2023 22:24
windows запрещенные символы.txt
https://ru.wikipedia.org/wiki/%D0%98%D0%BC%D1%8F_%D1%84%D0%B0%D0%B9%D0%BB%D0%B0
<pre>
Запрещённые символы
Многие операционные системы запрещают использование некоторых служебных символов.
Запрещённые символы Windows (в различных версиях):
\ — разделитель подкаталогов
@lmcneel
lmcneel / remove-node-modules.md
Last active July 9, 2024 19:06
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a