Skip to content

Instantly share code, notes, and snippets.

"Simplicity is prerequisite for reliability." Edsger W. Dijkstra

Anton Ivanov antivanov

"Simplicity is prerequisite for reliability." Edsger W. Dijkstra
View GitHub Profile
antivanov /
Last active Feb 5, 2020
Useful commands to free Docker space
# Stop and remove all containers
docker rm -f $(docker ps -a -q)
# Remove all images
docker rmi $(docker images -a -q)
# Remove other unused docker data, i.e. networks
docker system prune
# Remove all the unused docker volumes (frees lots of space!)
antivanov / launch.json
Created Aug 22, 2019 — forked from constantm/launch.json
Get VSCode debug and breakpoints to work with Vue Cli and Jest
View launch.json
"version": "0.2.0",
"configurations": [
"type": "node",
"name": "vue-cli-service-tests",
"request": "launch",
"env": {
"NODE_ENV": "test"
antivanov /
Last active Aug 13, 2019
Bash function to kill the processes using a particular port
# Add the function below to ~/.bashrc to make it available from command line
# Usage:
# $ free_port 8080
free_port() {
kill -9 $(lsof -t -i:$1)
antivanov / list_map_fold.scm
Created Oct 8, 2018
map and fold implementation for lists in Scheme
View list_map_fold.scm
; Maps function over list
; f - function of one argument, returns transformed argument
; l - list
(define (map f l)
(if (> (length l) 0)
(f (car l))
(map f (cdr l))
antivanov /
Created Sep 24, 2018
Command to create bootable USB with progress displayed using dd, pv
sudo dd if=./some.linux.iso | pv -s 2G | sudo dd of=/dev/sdb bs=8192
antivanov / akka_stream_example.scala
Created Mar 11, 2018
Simple example of a stream in Akka: source -> flow -> sink
View akka_stream_example.scala
object AkkaStreamExample extends App {
implicit val system = ActorSystem("MyActorSystem")
implicit val materializer = ActorMaterializer()
val source = Source(1 to 5)
val square = Flow[Int].map(x => x * x)
antivanov /
Last active Aug 20, 2020
Installing Python 3.6 on OpenSUSE Leap 42.3
# !/bin/bash
# Step 1. Install pyenv
git clone ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
source ~/.bashrc
antivanov /
Last active Aug 19, 2018
Better 'killall' command in Bash, analogous to 'kill -9' usage: ' java'
pids_to_kill=$(ps aux|grep $1|grep -v grep|grep -v |awk '{print $2}')
[[ ! -z $pids_to_kill ]] && kill -9 $pids_to_kill
antivanov /
Last active Aug 15, 2018
Bash command that finds subdirectories of the current directory that are larger than 1Gb
du -h | grep '^[0-9]\.*[0-9]*G'
antivanov / browser_text_mode.js
Created May 17, 2017
Remove images, videos and backgrounds from the web page to leave only the text content
View browser_text_mode.js
(function() {
function toArray(arrayLike) {
return [];
function $(cssSelector) {
return toArray(document.querySelectorAll(cssSelector));
You can’t perform that action at this time.