Skip to content

Instantly share code, notes, and snippets.

Anton Ivanov antivanov

Block or report user

Report or block antivanov

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
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 Jul 9, 2019
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));
antivanov / generator_demo.js
Created Apr 4, 2017
Simple demo of generators in JavaScript
View generator_demo.js
function print(obj) {
console.log(JSON.stringify(obj, null));
function* gen() {
var x = yield 'a';
var y = yield 'b';
var z = yield 'c';
return [x, y, z];
You can’t perform that action at this time.