Skip to content

Instantly share code, notes, and snippets.

View alexey-sh's full-sized avatar
❤️

Aleksey Shaposhnikov alexey-sh

❤️
  • Russia, Saint Petersburg
View GitHub Profile
@alexey-sh
alexey-sh / main.js
Created March 3, 2016 09:18
alfabank currencies
function loadScript () {
return $.getScript('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js');
}
function loadData () {
return $.getJSON('https://alfabank.ru/ext-json/0.2/exchange/cash/?offset=0&limit=20').then(function (d) { return d.response.data.usd.filter(function (x) {return x.type==='buy'}); });
}
function drawChart () {
$.when(loadData(), loadScript()).then(function (currencies) {
@alexey-sh
alexey-sh / pikabu-quick-ban.js
Created May 13, 2023 14:48
Кнопка для быстрого бана автора поста на пикабу
function getXCsrfToken() {
const data = JSON.parse(document.querySelector('[data-entry="initParams"]').innerText);
return data.csrfToken;
}
function banRequest(userId, xCsrfToken) {
const data = `authors=${userId}&communities=&tags=&keywords=&period=forever&action=add_rule`;
const url = 'https://pikabu.ru/ajax/ignore_actions.php';
@alexey-sh
alexey-sh / README.MD
Last active December 31, 2023 16:14
Simple monitoring

To avoid permission error of loki container:

chown -R 10001:10001 /var/lib/docker/volumes/monitoring_loki_data_rules/*
chown -R 10001:10001 /var/lib/docker/volumes/monitoring_loki_data_chunks/*
@alexey-sh
alexey-sh / local-config.yaml
Created November 11, 2023 14:04
Pino, docker, promtail, loki and grafana
auth_enabled: false
target: all
http_prefix: ""
ballast_bytes: 0
use_buffered_logger: true
use_sync_logger: true
common:
path_prefix: /loki