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 / 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
View useful_pandas_snippets.py
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# 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
yevgenko / list_view_spec.js.coffee
Created Jan 26, 2016
Sample Spec for the View class of marionette module
View list_view_spec.js.coffee
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', ->
expect(true).toBeTruthy()
@yevgenko
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)
end
def render(params)
_render_template params
end
View compile.php5.3.25.txt
http://phpconfigure.com/
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
<header>
<script type="text/html" id="options-template">
<% for (i = 0; i < items.length; i++) { %>
<option value="<%= items[i].id %>"><%= items[i].value %></option>
<% } %>
</script>
</header>
@yevgenko
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 'https://rubygems.org'
gem 'mws-rb', git: 'https://github.com/veeqo/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
yevgenko / rails-TODO.md
Last active Dec 18, 2015
Things TODO for new rails app
View rails-TODO.md

Engineering Tasks

  • add .ruby-version file
  • verify secret token are safe
  • install rspec + capybara
  • update README file
@yevgenko
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"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
You can’t perform that action at this time.