Skip to content

Instantly share code, notes, and snippets.


Viktor Evdokimov viktor-evdokimov

View GitHub Profile
require 'csv'
require 'open-uri'

csv_text = open('http://www.vvv.hh.yyy.ggg/~hhhh/uuuu.csv')
csv = CSV.parse(csv_text, :headers=>true)
csv.each do |row|
  puts row
viktor-evdokimov /
Created May 25, 2018 — forked from staltz/
The introduction to Reactive Programming you've been missing
viktor-evdokimov /
Last active Apr 13, 2018
pre-commit git hook to stop you from commiting binding.pry
exec 1>&2
if test $(git diff --cached -S'binding.pry' --name-only |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
cat <<\EOF
Remove biniding.pry
exit 1
viktor-evdokimov / Untitled-3
Last active Apr 5, 2018
return which shell is used
View Untitled-3
# return which shell is used
> echo $0
viktor-evdokimov / index.js
Created Oct 30, 2017
Node.js and micro simple web service for running in K8S with draft
View index.js
const http = require('http')
const { run, send, json } = require('micro')
const PORT = process.env.PORT || 8080
const response = "Hi from MICROservice on K8S draft"
const microHttp = fn => http.createServer((req, res) => run(req, res, fn))
const server = microHttp(async (req, res) => {
const js = await json(req);
const statusCode = 200;
const data = { ...js, response };
viktor-evdokimov / Gemfile
Created Oct 30, 2017
Simple sinatra powered ruby service
View Gemfile
# frozen_string_literal: true
source ""
git_source(:github) {|repo_name| "{repo_name}" }
gem "sinatra", "~> 2.0"
gem "json", "~> 2.1"
viktor-evdokimov /
Created Jul 14, 2017 — forked from pixelhandler/
Git pre-push hook to prevent force pushing master branch
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
# If this script exits with a non-zero status nothing will be pushed.
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
viktor-evdokimov /
Created Jun 19, 2017
publish myjson.json to rabbitmq
bash python rabbitmqadmin publish exchange=amq.default routing_key=test payload="$(cat myjson.json)"
viktor-evdokimov /
Created Jun 6, 2017
move last commit to the new branch
# Moving to a new branch
# Unless there are other circumstances involved, this can be easily done by branching and rolling back.
# Note: Any changes not committed will be lost.
git branch newbranch # Create a new branch, saving the desired commits
git reset --hard HEAD~1 # Move master back by 3 commits (GONE from master)
git checkout newbranch # Go to the new branch that still has the desired commits
View git-reup
#!/usr/bin/env ruby
# Usage: git-up
# git-reup
# Like git-pull but show a short and sexy log of changes
# immediately after merging (git-up) or rebasing (git-reup).
# Inspired by Kyle Neath's `git up' alias: