Skip to content

Instantly share code, notes, and snippets.

View viktor-evdokimov's full-sized avatar
👷‍♂️
Focusing

Viktor Evdokimov viktor-evdokimov

👷‍♂️
Focusing
View GitHub Profile
@viktor-evdokimov
viktor-evdokimov / 1-setup-git-gpg.md
Last active July 12, 2022 19:40 — forked from troyfontaine/1-setup.md
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 krypt.co

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
end
@viktor-evdokimov
viktor-evdokimov / introrx.md
Created May 25, 2018 17:00 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@viktor-evdokimov
viktor-evdokimov / pre-commit.sh
Last active April 13, 2018 22:29
pre-commit git hook to stop you from commiting binding.pry
#!/bin/sh
exec 1>&2
if test $(git diff --cached -S'binding.pry' --name-only |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Remove biniding.pry
EOF
exit 1
fi
@viktor-evdokimov
viktor-evdokimov / Untitled-3
Last active April 5, 2018 23:26
return which shell is used
# return which shell is used
> echo $0
-zsh
@viktor-evdokimov
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
viktor-evdokimov / Gemfile
Created October 30, 2017 05:41
Simple sinatra powered ruby service
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "sinatra", "~> 2.0"
gem "json", "~> 2.1"
@viktor-evdokimov
viktor-evdokimov / pre-push.sh
Created July 14, 2017 22:38 — forked from pixelhandler/pre-push.sh
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# 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
viktor-evdokimov / rbt_publish.sh
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
viktor-evdokimov / move_to_new_branch.sh
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
#from https://stackoverflow.com/questions/1628563/move-the-most-recent-commits-to-a-new-branch-with-git