This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table test (a varchar(255), b varchar(255), c integer); | |
create unique index idx_test_a_b on test (a, b); | |
insert into test values ('a', 'foo', 1); | |
select * from test; | |
insert into test values ('a', 'foo', 1) on conflict (a, b) do update set a = 'c'; | |
select * from test; | |
drop table test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"%{title}. Читать подбробнее" % { title: @news_of_the_day.first(2).map(&:title) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionDispatchPatch | |
module Utils | |
def check_param_encoding(params) | |
case params | |
when Array | |
params.each { |element| check_param_encoding(element) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NumericExt | |
def humanize_time | |
secs = self | |
[ | |
[60, :сек], | |
[60, :мин], | |
[24, :ч], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):008:0> req = Laximo.oem.get_wizard2('CH1106') | |
opening connection to ws.laximo.net:443... | |
opened | |
starting SSL for ws.laximo.net:443... | |
SSL established | |
<- "POST /ec.Kito.WebCatalog/services/Catalog.CatalogHttpSoap11Endpoint/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: LaximoRuby [0.4.2]\r\nContent-Type: text/xml; charset=UTF-8\r\nSoapaction: \"http://WebCatalog.Kito.ec\"\r\nConnection: close\r\nHost: ws.laximo.net\r\nContent-Length: 579\r\n\r\n" | |
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\nxmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <SOAP-ENV:Body>\n <ns5692:QueryData xmlns:ns5692=\"http://WebCatalog.Kito.ec\">\n <request xsi:type=\"xsd:string\">GetWizard2:Locale=ru_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):007:0* req = Laximo.oem.get_wizard2('ch1106') | |
opening connection to ws.laximo.net:443... | |
opened | |
starting SSL for ws.laximo.net:443... | |
SSL established | |
<- "POST /ec.Kito.WebCatalog/services/Catalog.CatalogHttpSoap11Endpoint/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: LaximoRuby [0.4.2]\r\nContent-Type: text/xml; charset=UTF-8\r\nSoapaction: \"http://WebCatalog.Kito.ec\"\r\nConnection: close\r\nHost: ws.laximo.net\r\nContent-Length: 579\r\n\r\n" | |
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\nxmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <SOAP-ENV:Body>\n <ns5692:QueryData xmlns:ns5692=\"http://WebCatalog.Kito.ec\">\n <request xsi:type=\"xsd:string\">GetWizard2:Locale=ru_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> req = Laximo.oem.get_wizard2('DACIA201507') | |
opening connection to ws.laximo.net:443... | |
opened | |
starting SSL for ws.laximo.net:443... | |
SSL established | |
<- "POST /ec.Kito.WebCatalog/services/Catalog.CatalogHttpSoap11Endpoint/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: LaximoRuby [0.4.2]\r\nContent-Type: text/xml; charset=UTF-8\r\nSoapaction: \"http://WebCatalog.Kito.ec\"\r\nConnection: close\r\nHost: ws.laximo.net\r\nContent-Length: 584\r\n\r\n" | |
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\nxmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <SOAP-ENV:Body>\n <ns5692:QueryData xmlns:ns5692=\"http://WebCatalog.Kito.ec\">\n <request xsi:type=\"xsd:string\">GetWizard2:Local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):002:0> req = Laximo.oem.find_vehicle_by_vin('JMZGH12F701448756') | |
opening connection to ws.laximo.net:443... | |
opened | |
starting SSL for ws.laximo.net:443... | |
SSL established | |
<- "POST /ec.Kito.WebCatalog/services/Catalog.CatalogHttpSoap11Endpoint/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: LaximoRuby [0.4.2]\r\nContent-Type: text/xml; charset=UTF-8\r\nSoapaction: \"http://WebCatalog.Kito.ec\"\r\nConnection: close\r\nHost: ws.laximo.net\r\nContent-Length: 603\r\n\r\n" | |
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\nxmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <SOAP-ENV:Body>\n <ns5692:QueryData xmlns:ns5692=\"http://WebCatalog.Kito.ec\">\n <request xsi:type=\"xsd:string\">Fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):038:0* Laximo.oem.list_catalogs | |
opening connection to ws.laximo.net:443... | |
opened | |
starting SSL for ws.laximo.net:443... | |
SSL established | |
<- "POST /ec.Kito.WebCatalog/services/Catalog.CatalogHttpSoap11Endpoint/ HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: LaximoRuby [0.4.2]\r\nContent-Type: text/xml; charset=UTF-8\r\nSoapaction: \"http://WebCatalog.Kito.ec\"\r\nConnection: close\r\nHost: ws.laximo.net\r\nContent-Length: 561\r\n\r\n" | |
<- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\nxmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\">\n <SOAP-ENV:Body>\n <ns5692:QueryData xmlns:ns5692=\"http://WebCatalog.Kito.ec\">\n <request xsi:type=\"xsd:string\">ListCatalogs:Locale=ru_RU</request> |