Skip to content

Instantly share code, notes, and snippets.

Ruslan Kiyanchuk zoresvit

Block or report user

Report or block zoresvit

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zoresvit
zoresvit / updates.sh
Created Dec 7, 2019
Arch Linux updates notification
View updates.sh
#!/bin/bash
update=$(checkupdates)
if [ ! -z "$update" ]
then
sudo -u ${USER} DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \
notify-send 'Updates' "$update" --icon=dialog-information
fi
@zoresvit
zoresvit / keybase.md
Created Sep 29, 2018
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am zoresvit on github.
  • I am zoresvit (https://keybase.io/zoresvit) on keybase.
  • I have a public key whose fingerprint is A48C 4FD6 AEEE 19F6 1D0E C3B5 FAFC BE8A D9CD 1CF9

To claim this, I am signing this object:

@zoresvit
zoresvit / fib_benford_law.py
Created Apr 20, 2017
Benford's law in Fibonacci sequence
View fib_benford_law.py
"""Verify that Fibonacci sequence follows Benford's law."""
from pprint import pprint
def fibonacci(n):
a, b = 0, 1
for i in range(n):
a, b = b, a + b
return a
@zoresvit
zoresvit / mutelock.sh
Created Apr 11, 2016
Mute audio on screen lock
View mutelock.sh
#!/bin/bash
# Mute volume on screen lock.
# Listen DBUS queue to get signal from Gnome Screensaver about lock events.
DBUS_SESSION="type='signal',interface='org.gnome.ScreenSaver'"
MUTE_COMMAND="${HOME}/.xmonad/volume.sh mute"
function mute_on_lock() {
while IFS= read -r line; do
@zoresvit
zoresvit / uppercase-chap.tex
Last active Dec 17, 2015
LaTeX uppercase chapter title. Compatible with hyperref, no side effects.
View uppercase-chap.tex
% Make chapter titles uppercase is a pain.
% The internal chapter macros must be redefined.
\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
You can’t perform that action at this time.