Skip to content

Instantly share code, notes, and snippets.

@selim13
selim13 / tinkoff-monitor.sh
Created March 3, 2022 19:32
tinkoff-monitor
#!/usr/bin/env bash
TG_TOKEN="XXXX"
TG_CHAT_ID="XXXX"
tg_send_message() {
if [[ -z "$TG_TOKEN" || -z "$TG_CHAT_ID" ]]; then
return
fi
local message="$1"
@selim13
selim13 / gnome-more-workspaces.sh
Last active July 3, 2021 09:43
Add more gnome workspaces
#!/bin/sh
# Increases number of GNOME workspaces to 10.
# Binds Super+number to switch workspaces and Super+Shift+number to move
# windows between workspaces.
#
# See:
# https://askubuntu.com/questions/1195081/increase-number-of-workspace-with-shortcuts-on-ubuntu-18-04
gsettings set org.gnome.mutter dynamic-workspaces false
@selim13
selim13 / example.css
Last active February 17, 2021 16:36
Font subset
/* latin */
@font-face {
font-family: "Pragmatica Extended";
font-weight: 700;
font-display: swap;
src: local("Pragmatica Extended Bold"), local("Pragmatica Extended-Bold"),
url(../fonts/PragmaticaExtended-Bold.latin.woff2) format("woff2"),
url(../fonts/PragmaticaExtended-Bold.latin.zopfli.woff) format("woff");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
@selim13
selim13 / download.sh
Last active February 14, 2021 19:00
nice.purrsia.com freefall forum web archive download
#!/bin/bash
if [ ! -f './freefall_topics.txt' ]; then
curl 'http://web.archive.org/cdx/search/cdx?url=http://nice.purrsia.com/cgi-bin/*&output=txt&filter=statuscode:200&collapse=urlkey' \
| grep 'ubb=get_topic' | grep 'f=21' > ./freefall_topics.txt
fi
IFS=$'\n'
for LINE in $(cat ./freefall_topics.txt | awk -F ' ' '{print $2,$3}'); do
TIMESTAMP=${LINE%% *}
@selim13
selim13 / colors.js
Created November 16, 2019 15:05
Material design colors object
export default {
black: '#000000',
white: '#ffffff',
red50: '#ffebee',
red100: '#ffcdd2',
red200: '#ef9a9a',
red300: '#e57373',
red400: '#ef5350',
red500: '#f44336',
red600: '#e53935',
@selim13
selim13 / uart.c
Last active September 24, 2019 08:15
stm32 uart ring buffer
#include "uart.h"
char uartRxBuffer[UART_RX_BUFFER_SIZE];
uint8_t uartRxCounter = 0;
uint8_t uartRxReadIdx = 0;
uint8_t uartRxWriteIdx = 0;
uint8_t uartRxOverflow = 0;
bool uartRxCr = false;
char uartTxBuffer[UART_TX_BUFFER_SIZE];
@selim13
selim13 / index.html
Created March 7, 2018 20:26 — forked from imevro/index.html
Minimally working version of SSR (react, react-router, react-helmet, styled-components; implying use of react-scripts without eject)
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="$helmet-placeholder$">
<meta name="$sc-placeholder$">
<style>