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 / animal_service_client_spec.rb
Created Mar 2, 2017
Example of using pact with webmock, i.e. to proxy connection via Rack application to mock service without changing base_url in client library
View animal_service_client_spec.rb
require 'httparty'
require_relative 'pact_helper'
require 'webmock/rspec'
require 'byebug'
require 'rack/proxy'
WebMock.disable_net_connect!(allow_localhost: true)
class Alligator
attr_reader :name
# List unique values in a DataFrame column
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
yevgenko /
Created Jan 26, 2016
Sample Spec for the View class of marionette module
describe 'ProductsApp.List', ->
List = App.module "ProductsApp.List"
describe 'Products', ->
productsView = new List.Products
collection: new Backbone.Collection []
describe 'click .publish_selected', ->
it 'triggers publish:selected:clicked event', ->
yevgenko / template_renderer.rb
Created Jan 19, 2016
Sample class shows one way to wrap Liquid library
View template_renderer.rb
class TemplateRenderer
attr_reader :parsed_template
def initialize(template)
@parsed_template = template.respond_to?(:parase) ? template : _parse_template(template)
def render(params)
_render_template params
View compile.php5.3.25.txt
See before:
compile.mysql5.6.12.txt & compile.apache2.4.4.txt
Compile php 5.3.25
sudo mkdir /usr/local/php
sudo mkdir /usr/local/php/php_5.3.25
View index.html
<script type="text/html" id="options-template">
<% for (i = 0; i < items.length; i++) { %>
<option value="<%= items[i].id %>"><%= items[i].value %></option>
<% } %>
yevgenko / Gemfile
Last active Aug 29, 2015
Parser for Amazon Marketplace Web Service XSD's: Retrieves the list of DataNodes (referenced as Product Category XSDs) and ProductType for the corresponding DataNode
View Gemfile
source ''
gem 'mws-rb', git: ''
View soap_client_example.rb
require 'savon'
module Foobarservice
class Client
attr_accessor :wsdl, :user_id, :token
def initialize(attrs = {})
attrs.each do |k,v| send("#{k}=", v) end
@client = Savon.client(wsdl: @wsdl) do
yevgenko /
Last active Dec 18, 2015
Things TODO for new rails app

Engineering Tasks

  • add .ruby-version file
  • verify secret token are safe
  • install rspec + capybara
  • update README file
yevgenko / pom.xml
Last active Dec 15, 2015
Add Robolectric to AndroidKickstartr generated pom file, see revisions
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
You can’t perform that action at this time.