Skip to content

Instantly share code, notes, and snippets.

View nikto-b's full-sized avatar
🦾
Running tea binary

nikto_b nikto-b

🦾
Running tea binary
  • Newt.team
  • Moscow, Russia
View GitHub Profile
.include "m32def.inc"
.org 0
; ЛР 3
; Частота смены последовательности:
; 125ms / 8Hz
; Последоавтельности:
; 11111111
; 01111110
#!/bin/bash
DUNST=`pidof dunst`
FOCUSED=$(swaymsg -t get_tree | jq '.. | (.nodes? // empty)[] | select(.focused and .pid) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')
OUTPUTS=$(swaymsg -t get_outputs | jq -r '.[] | select(.active) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')
WINDOWS=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')
if [[ "$1" == "" ]]; then
CHOICE=`dmenu -l 10 -p "How to make a screenshot?" << EOF
@nikto-b
nikto-b / proguard-rules.pro
Created March 12, 2021 13:05
google_maps_flutter android proguard-rules file
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
#
# Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
# the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
# will be ignored by new version of the Android plugin for Gradle.
# Optimizations can be turned on and off in the 'postProcessing' DSL block.
# The configuration below is applied if optimizations are enabled.
# Adding optimization introduces certain risks, since for example not all optimizations performed by
# ProGuard works on all versions of Dalvik. The following flags turn off various optimizations
@nikto-b
nikto-b / reportGen.sh
Created December 17, 2020 00:35
generate homework report from many images
#!/bin/bash
files=$(ls photo*.jpg)
count=1
for i in $(echo $files); do
cp $i ./$count.jpg
jpegoptim --size=100K $count.jpg
count=$(($count+1))
done
from rich.console import Console
from rich.markdown import Markdown
if __name__ == "__main__":
if sys.argv[1:]:
console = Console()
with open(sys.argv[1:][0]) as readme:
markdown = Markdown(readme.read())
console.print(markdown)
#!/bin/python
"""
A rudimentary URL downloader (like wget or curl) to demonstrate Rich progress bars.
"""
from concurrent.futures import ThreadPoolExecutor
from functools import partial
import os.path
import sys
from typing import Iterable
from urllib.request import urlopen
@nikto-b
nikto-b / labs.sh
Last active December 16, 2020 23:59
#get all files in $DIR that matches $NAME created last $MINUTE minutes, sort them in alphabet,
#copy in current dir as jpg(sorry) and try to compress in $SIZE size (for example 400K)
export count=1
export files="$(find $DIR -type d -name $NAME -prune -o -mmin -MINUTE -type f -print | rg -v '\(' | sort -t _ -k 2 -g | tr '\n' ' ')"
for i in $(echo $files); do
cp $i ./$count.jpg
jpegoptim --size=$SIZE $count.jpg
count=$(($count+1))
done
@nikto-b
nikto-b / Makefile
Last active May 12, 2020 22:32
avr-gcc automatic makefile
BUILD_DIR=Build
SRC_DIR=Src
INC_DIR=Inc
CC=avr-gcc
LD=avr-ld
LIBS=
STANDART=c99
OPTIMIZE=-Os
TARGET=main
MCU=atmega128
@nikto-b
nikto-b / sum.sh
Created May 4, 2020 13:25
Bash one-liner that summs integers divisable by 3
#it's important to have space after last integer
echo "1 2 3 4 5 " | tee a | sed 's/\s/\/3\n/g' | bc -l | sed 's/00//g' | sed 's/.$//g' | nl | grep -v '\.' | awk '{print $1}' > b; export A=$(cat a | sed 's/\s/\n/g'); export B=$(cat b); for i in $B; do echo -e "$A" | sed "${i}q;d" ; done | tr '\n' ' ' | rev | cut -c 2- | rev | sed 's/\s/+/g' | bc