Skip to content

Instantly share code, notes, and snippets.

View viktor-evdokimov's full-sized avatar

Viktor Evdokimov viktor-evdokimov

View GitHub Profile
viktor-evdokimov /
Last active July 12, 2022 19:40 — forked from troyfontaine/
Signing your Git Commits using GPG on MacOS

Methods of Signing with GPG on MacOS

Last updated June 23, 2022

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

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 17:00 — forked from staltz/
The introduction to Reactive Programming you've been missing
viktor-evdokimov /
Last active April 13, 2018 22:29
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 April 5, 2018 23:26
return which shell is used
# return which shell is used
> echo $0
viktor-evdokimov / index.js
Created October 30, 2017 06:21
Node.js and micro simple web service for running in K8S with draft
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 October 30, 2017 05:41
Simple sinatra powered ruby service
# frozen_string_literal: true
source ""
git_source(:github) {|repo_name| "{repo_name}" }
gem "sinatra", "~> 2.0"
gem "json", "~> 2.1"
viktor-evdokimov /
Created July 14, 2017 22:38 — 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 June 19, 2017 17:05
publish myjson.json to rabbitmq
bash python rabbitmqadmin publish exchange=amq.default routing_key=test payload="$(cat myjson.json)"
viktor-evdokimov /
Created June 6, 2017 17:30
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