Skip to content

Instantly share code, notes, and snippets.

View esshka's full-sized avatar
🏠
Working from home

Eugeny esshka

🏠
Working from home
View GitHub Profile
const transferNodes =
transfers.map(tid =>
<TransferRow {...{
transfer: transfersById[tid],
key: `transfer-${tid}`,
toggleSelected: () => actions.toggleSelected(transfersById[tid]),
approveTransfer: () => actions.transferActionRequested(transfersById[tid], 'approve'),
cancelTransfer: () => actions.transferActionRequested(transfersById[tid], 'cancel'),
isLoading,
isSelected: some(selectedTransfers, stid => stid === tid)
import React, { Component } from 'react';
export default class CircleProgress extends Component {
static defaultProps = {
strokeWidth: 6,
strokeColor: '#3FC7FA',
trailWidth: 6,
trailColor: '#D9D9D9',
};
[101] pry(main)> h = {date: Date.parse("06.04.2016"), sourceCurrency: "USD", targetCurrency: "EUR"}
=> {:date=>Wed, 06 Apr 2016, :sourceCurrency=>"USD", :targetCurrency=>"EUR"}
[102] pry(main)> result = client.call(:get_currency_rates, message: { :getCurrencyRates => [h,h] })
class CurrencyRateRequestBeanContainer < WashOut::Type
type_name 'currencyRateRequestBean'
map :currencyRateRequest => {
date: :datetime,
sourceCurrency: :string,
targetCurrency: :string
}
end
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://v1.currency.integration.commons.tain.se" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="currency_rate_service_soap" targetNamespace="http://v1.currency.integration.commons.tain.se">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://v1.currency.integration.commons.tain.se">
<xsd:complexType name="getCurrencyRates">
<xsd:sequence>
<xsd:element name="currencyRatesRequest" type="tns:currencyRateRequestBean"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="currencyRateRequestBean">
<xsd:sequence>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://v1.currency.integration.commons.tain.se" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="currency_rate_service_soap" targetNamespace="http://v1.currency.integration.commons.tain.se">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://v1.currency.integration.commons.tain.se">
<xsd:complexType name="getCurrencyRates">
<xsd:sequence>
<xsd:element name="currencyRatesRequest" type="tns:currencyRateRequestBean"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="currencyRateRequestBean">
<xsd:sequence>
@esshka
esshka / react-testing-in-rails.diff
Created April 12, 2016 00:19 — forked from jakecraige/react-testing-in-rails.diff
Simple react component testing in rails + capybara
commit 074a79b95e66d999abe500051c5337805575ea3f
Author: Jake Craige <[email protected]>
Date: Tue Apr 7 10:14:29 2015 -0700
Add testing infastructure for React components
diff --git a/app/controllers/components_controller.rb b/app/controllers/components_controller.rb
new file mode 100644
index 0000000..4ffc308
--- /dev/null
@esshka
esshka / sc.js
Created March 21, 2016 01:06
simple carousel on react
state = {
offset: 0,
items: [],
itemsVisible: 4,
width: 800,
height: 100,
};
componentDidMount() {
this.setState({items: initialItems})
@esshka
esshka / gist:11dc9db2c1a2b2c2b160
Created February 29, 2016 12:52 — forked from jacqui/gist:983051
Redis SORT command examples
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
@esshka
esshka / apiclamps.js
Last active February 24, 2016 18:58
api clamps
// Выборка смыканий из базы
`SELECT time, type, duration, rnum, den
FROM (SELECT time, type, duration,
row_number() over(ORDER BY time ASC) rnum,
((select count(*) from clamps where device_id = ${deviceId}) / 200) den
FROM clamps
WHERE clamps.device_id = ${deviceId}
AND (clamps.time BETWEEN '${s}' AND '${e}')
ORDER BY time ASC) full_clamps