Skip to content

Instantly share code, notes, and snippets.

Yevhen Viktorov yevgenko

Block or report user

Report or block yevgenko

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
@yevgenko
yevgenko / .Xdefaults
Created Aug 24, 2011
URxvt settings with solarized theme
View .Xdefaults
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@yevgenko
yevgenko / pastebin.sh
Created Feb 11, 2012
PASTEBIN.COM BASH SCRIPT – PASTE DIRECTLY FROM YOUR TERMINAL
View pastebin.sh
#!/bin/bash
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : Novemeber 7, 2010
#help function
howto()
{
echo "\
Pastebin.com Bash Script \
@yevgenko
yevgenko / seriallogger.js
Created Jan 3, 2012 — forked from voodootikigod/seriallogger.js
Log all output from a serial port connection to a log file.
View seriallogger.js
/*
Simple example that takes a command line provided serial port destination and routes the output to a file of the same name with .log appended to the port name.
usage: node logger.js /dev/tty.usbserial <baudrate>
*/
var SerialPort = require("serialport");
var fs = require("fs");
var port = process.argv[2];
View rails_assets_connection_refused.md

The Problem

bundle install
> Fetching source index from https://rails-assets.org/
> 
> Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rails-assets.org/
> Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rails-assets.org/
> Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rails-assets.org/
> Could not fetch specs from https://rails-assets.org/
@yevgenko
yevgenko / flatfile_io_json2csv.rb
Last active Jul 16, 2019
Convert flatfile.io output (key-value map) to CSV string.
View flatfile_io_json2csv.rb
require 'csv'
require 'json'
def flatfile_io_json2csv_string(data_as_string = '[{"sku_code": "123"}, {"sku_code": "321"}]')
CSV.generate do |csv|
json_data = JSON.parse(data_as_string)
csv << json_data.first.keys # header
json_data.each do |hash|
csv << hash.values
@yevgenko
yevgenko / single_message_listener.rb
Created May 1, 2019
GOOS: auction snipper, single message listener
View single_message_listener.rb
#
# https://github.com/yevgenko/ruby-auction_sniper/blob/master/spec/fake_auction_server.rb
#
# https://www.safaribooksonline.com/library/view/growing-object-oriented-software/9780321574442/ch11.html
#
class SingleMessageListener
include RSpec::Matchers
def initialize
@messages = SizedQueue.new(1)
@yevgenko
yevgenko / self_shunt_spec.rb
Created Mar 5, 2019
Self Shunt vs Fake Object in Ruby / RSpec
View self_shunt_spec.rb
module Fubarizable
def fubarize
"foobar-#{fubarizable}-foobar"
end
end
class FakeFoobar
include Fubarizable
def fubarizable
View docker-elastic.sh
#!/bin/sh
docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:5.4.1
View designing_end_to_end_test.txt
title Designing End To End Test
Test->ApplicationRunner: perform_foobar_for(order)
ApplicationRunner->OrderPage: perform_action(Order::ACTION_FOOBAR)
OrderPage->CapybaraPage: visit('/orders/order.id')
OrderPage->CapybaraPage: click(text)
Test->ApplicationRunner: has_shown_foobar_status_for(order)
ApplicationRunner->OrderPage: shows_status(Order::STATUS_FOOBAR)
OrderPage->CapybaraPage: visit('/orders/order.id')
OrderPage->CapybaraPage: assert_text(text)
View foobar.rb
def greeting
puts 'hello, world!'
end
You can’t perform that action at this time.