Skip to content

Instantly share code, notes, and snippets.

View Kyborg2011's full-sized avatar
🏠
Working from home

Anton Babinin Kyborg2011

🏠
Working from home
View GitHub Profile
@Kyborg2011
Kyborg2011 / MilkDropVisualizer.cpp
Created July 8, 2024 22:29
MilkDropVisualizer.cpp
# MilkDropVisualizer.h:
#ifndef CADENZA_MUSIC_PLAYER_MILKDROPVISUALIZER_H
#define CADENZA_MUSIC_PLAYER_MILKDROPVISUALIZER_H
#include <vector>
#include <span>
#include "interfaces/IPostProcessor.h"
#include "utils/log.h"
#include "utils/constants.h"

I have two user accounts set up on my mac. User drew I use for most things, but if I'm making a screencast I'll switch to the demo user. I know that the demo user has a clean desktop, and the font size is larger than usual in my terminal and text editors, making everything a bit more legible when capturing the screen. When I record a screencast as the demo user, I save the file to /Users/Shared/screencasts. As I understand it, the /Users/Shared directory is supposed to be accessible to all user accounts on the mac. If I created and saved a screenflow document as the demo user, I should be able to read and write that file when logged in as user drew.

That was the theory, but it didn't always work out that well in practice. I would occasionally find that a directory was only writable by one user or the other. Perhaps I'd open a screenflow document as user drew and attempt to export the video to the same directory, only to find that the directory was owned by demo, meaning that I couldn't cr

#!/usr/bin/env python3
### INSTALLATION REQUIREMENTS:
### sudo apt-get update
### sudo apt-get install python3-pip
### sudo python3 -m pip install --upgrade pip setuptools wheel
### sudo pip3 install Adafruit_DHT
### BUG FIXES:
### On RPI4 you need to add in file /usr/local/lib/python3.7/dist-packages/Adafruit_DHT/platform_detect.py at line 112:
@Kyborg2011
Kyborg2011 / .hyper.js
Created June 3, 2020 01:50
Hyper — full configuration
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@Kyborg2011
Kyborg2011 / bitcoin-cli-rpc-connect.sh
Last active February 1, 2020 18:32
Connect through RPC using bitcoin-cli to external full node
# From that article: https://www.blockchain.com/api/json_rpc_api
./bitcoin-cli -rpcconnect=<HOST> -rpcport=<PORT> -rpcuser=<USER> -rpcpassword="<PASS>" getwalletinfo
@Kyborg2011
Kyborg2011 / repaire-damaged-ext-drive.sh
Created January 22, 2020 11:28
Repairing damaged external drive (flash drive) on OS X
# If "Disk Utility" can't erase a demaged disk and throw errors, like these:
# a) "-69888: Couldn't unmount disk";
# b) "Couldn't modify partition map".
# You can repair disk (if it is damaged partially, just by a program error, while changing partition map of a disk in) by
# FULL ERASING OF A DISK - you can do that ONLY in A COMMAND LINE, using "diskutil" command (on OS X)
# 1. Firstly you must get path of a drive in a system, like this:
diskutil list
# Than complete erasing of a disk:
diskutil eraseDisk free EMPTY /dev/disk4
@Kyborg2011
Kyborg2011 / .vimrc
Last active January 3, 2023 11:20
VIM editor configuration for making auto tabulation with 4 spaces length (file must be saved as "~/.vimrc")
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
set nu
syntax on
@Kyborg2011
Kyborg2011 / telegram-mailing.py
Last active August 6, 2019 18:05
A program for basic algorithm of a simplest mailing in Telegram Groups or/and Channels. Using a Telethon library (Python 3).
# For start up make in bash: 'python3 telegram-mailing.py'
from telethon import TelegramClient, sync
from telethon.tl.functions.channels import GetParticipantsRequest
from telethon.tl.types import ChannelParticipantsSearch
from telethon.tl.functions.channels import JoinChannelRequest
from telethon.tl.functions.channels import InviteToChannelRequest
from telethon.errors.rpcerrorlist import PeerFloodError
import time
import random
import sys
@Kyborg2011
Kyborg2011 / kill-all-processes-from-ps.sh
Created August 6, 2019 10:23
Kill all processes, fended by 'ps' command with some search string (grep)
kill $(ps aux | grep 'telegramapi.py' | awk '{print $2}')
@Kyborg2011
Kyborg2011 / .zshrc
Last active June 7, 2024 19:29
My '.bash_profile/.zshrc' settings file on MacOS:
# There was a warning about LANG, when used 'pipenv', so I have added it to conf:
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"