Skip to content

Instantly share code, notes, and snippets.

func (item *PriceRequestAction)FindRegionWS() *[]models.PriceResultItem{
results := []models.PriceResultItem{}
priceRequestAction := PriceRequestAction{}
copier.Copy(&priceRequestAction, item)
priceRequestAction.VisibleZoneId = 0
priceRequestAction.PriceRequest.Cross = true
priceRequestAction.CalledRegionWs = true
currentRegionId := item.PriceRequest.RegionId
if currentRegionId == 0 {
currentCustomer := db.Customer{}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"aggregateRating": {
"@type": "AggregateRating",
"bestRating": "100",
"ratingCount": "24",
"ratingValue": "87"
},
data_result = [["US - 258024 K", "Kg.", "<tbody> <tr> <th> VIBRACOUSTIC </th> <td> VI0058024 </td> </tr> </tbody>", "<tbody> <tr> <th> </th> <td> 7421821030 </td> </tr> </tbody>", "http://www.usmerkaucuk.com/products/details/c/74", "US - 258024 K.png"], ["US - 200907", "0,5 Kg.", "<tbody> <tr> <th> CONTITECH </th> <td> SZ828 </td> </tr> <tr> <th> AIRKRAFT </th> <td> 125122 </td> </tr> </tbody>", "<tbody> </tbody>", "http://www.usmerkaucuk.com/products/details/c/90", "US - 200907.png"]]
data_result.each do |row|
crosses = []
(2..3).each do |t|
html_doc = Nokogiri::HTML(row[t])
table_rows = html_doc.search('tbody tr')
make_name = table_rows[0].blank? ? '' : table_rows[0].text
oem = table_rows[1].blank? ? '' : table_rows[1].text
@sdilshod
sdilshod / development.log
Last active December 7, 2016 04:12
The action 'load' could not be found for PricesController
Connecting to database specified by database.yml
Started GET "/prices/453" for 127.0.0.1 at 2016-12-07 09:10:21 +0500
Processing by PricesController#show as HTML
Parameters: {"id"=>"453"}
User Load (1.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
UserNotificationSettings Load (0.8ms) SELECT "user_notification_settings".* FROM "user_notification_settings" WHERE "user_notification_settings"."user_id" = 1 LIMIT 1
 (0.3ms) BEGIN
 (0.9ms) UPDATE "users" SET "last_request_at" = '2016-12-07 04:10:23.170675', "perishable_token" = 'CAggBqQNP2EtTSygZNh', "updated_at" = '2016-12-07 04:10:23.173854' WHERE "users"."id" = 1
@sdilshod
sdilshod / GA
Created November 14, 2015 05:44
<script type="text/javascript">
(function() {
window._pa = window._pa || {};
pa.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + "//tag.marinsm.com/serve/53d212865be884e6aa00002b.js";
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pa, s);
})();
dataLayer = [];
window.virtualPageCollection = {};
</script>
class TextFieldCalculator
config:
ui:
openLinkSelector: '[role=open-calculator]'
sourceTextfieldSelector: '[role=calculator-source-field]'
inputfieldSelector: '[role=calculator-input-field]'
constructor: ()->
@bindings()
@$el = $ '[role=calculator-container]'
@charset "utf-8"
/* CSS Document */
html, body, div, h1, h2, h3, h4, h5, h6, p, ul, li, img, header, section, aside, footer, button
margin: 0
padding: 0
border: 0
body
@sdilshod
sdilshod / FullTrace
Last active August 29, 2015 14:20
error
SELECT "users".* FROM "users" WHERE "category_users"."connection_type" = "category_users"."favorite"
Rendered /home/sdilshod/.rvm/gems/ruby-1.9.3-p547@saturn/gems/activeadmin-0.6.6/app/views/active_admin/resource/index.html.arb (3724.5ms)
Completed 500 Internal Server Error in 4157ms
ActiveRecord::StatementInvalid - PG::Error: ERROR: missing FROM-clause entry for table "category_users"
LINE 1: SELECT "users".* FROM "users" WHERE "category_users"."conne...
^
: SELECT "users".* FROM "users" WHERE "category_users"."connection_type" = "category_users"."favorite":
(gem) activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1153:in `async_exec'
(gem) activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1153:in `exec_no_cache'
........................
gem 'geocoder'
#gem 'activeadmin'#, :github => 'gregbell/active_admin' bundle ругал на это и комментировал его
gem 'activeadmin'#, :github => 'gregbell/active_admin'
gem 'nokogiri'
gem 'fog' # добавил только это
gem 'wicked'
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem 'rack', '1.4.5'
gem 'rake', '10.0.3'
gem 'pg'
gem 'activerecord-postgres-hstore'
gem 'pg_search'
gem 'activerecord-postgres-array'