Skip to content

Instantly share code, notes, and snippets.

View rybak's full-sized avatar

Andrei Rybak rybak

View GitHub Profile
@rybak
rybak / gradle-org-current-redirector.user.js
Last active December 23, 2022 13:15
gradle.org: redirect current to actual version
// ==UserScript==
// @name gradle.org: redirect current to actual version
// @description Redirects /current/ to an exact version of Gradle docs for help created better permalinks to gradle.org
// @version 1
// @match https://docs.gradle.org/current/*
// @namespace http://tampermonkey.net/
// @license MIT
// @author Andrei Rybak
// @icon https://www.google.com/s2/favicons?sz=64&domain=gradle.org
// @grant none
@rybak
rybak / scroll-image-video.sh
Created June 25, 2021 16:24
ffmpeg incantation to convert a single long image into a rolling marquee-style video
#!/bin/bash
# ffmpeg -loop 1 -t 10 -i "${1:-1.png}" \
# -vf "crop=w=W:h=ih:x='(iw-W)*t/10':y=0" \
# -r 25 -pix_fmt yuv420p out.mp4
# ffmpeg -f lavfi -i color=s=1920x1080 -loop 1 -t 0.08 -i "input.png" \
# -filter_complex "[1:v]scale=1920:-2,setpts=if(eq(N,0),0,1+1/0.02/TB),fps=25[fg];[0:v][fg]overlay=x=-'t*h*0.02':eof_action=endall[v]" \
# -map "[v]" output.mp4
ffmpeg -f lavfi -i color=s=1920x1080 -loop 1 -t 0.08 -i "input.png" -filter_complex "[1:v]scale=1920:-2,setpts=if(eq(N\,0)\,0\,1+1/0.02/TB),fps=25[fg]; [0:v][fg]overlay=y=-'t*h*0.02':eof_action=endall[v]" -map "[v]" output.mp4
@rybak
rybak / no-backseat.html
Last active June 17, 2020 11:38
DVD-screensaver-like animation
<html>
<head>
<title>DVD screensaver</title>
<style>
.text {
font-family: monospace;
font-size: 600%;
color: red;
animation: color-change 3s infinite;
white-space: nowrap;
@rybak
rybak / table-flip.py
Created September 26, 2018 12:23
Script to flip HTML-like tables upside down
#
# Helper script to flip HTML-like tables with tbody tags upside down
#
# MIT License
# Copyright (c) 2018 Andrei Rybak
#
def pretty_print_tr(a_tr):
return ''.join(a_tr)
@rybak
rybak / ps1_notifications-2018-08.sh
Last active February 22, 2022 04:04
PS1 setup with sad smiley for process failure and dangerous bend symbol for README files
#!/bin/bash
# Cleaned up version of ps1_notifications.sh made on 2018-08-05
#
# See rybak/scriptps github repository for the full version
# link: https://github.com/rybak/scripts/blob/master/config/ps1_notifications.sh
# copy of lib/colors.sh instead of calling source "$HOME/scripts/lib/colors.sh"
BLACK_FG="$(tput setaf 0)"
@rybak
rybak / compare-teamcity-tests.sh
Last active September 26, 2018 12:43
TeamCity generates a CSV file with list of all run tests. Sometimes it is useful to compare these lists on different builds. This scripts helps to do just that.
#!/usr/bin/bash
#
# MIT License
# Copyright (c) 2018 Andrei Rybak
#
set -u
set -e
@rybak
rybak / gist:4389033
Last active December 10, 2015 05:38
В файле filename + ".in" в первой строке — число тестов, со следующей строки — тесты в формате <вход>\n<ответ>. После этого нужно добавить строки accept: AC reject: RJ blank: _ start: S В конце — описание машины Тьюринга. Функцию check, если хочется, можно написать.
import java.io.*;
import java.util.*;
public class InterpretatorMulti {
int tapesCount;
String blank;
State accept;
State reject;
State start;
Map<String, State> states;