Skip to content

Instantly share code, notes, and snippets.

function FindProxyForURL(url, host) {
if (shExpMatch(url, "*robotdata.int.starship.xyz*")) {
return 'PROXY 127.0.0.1:3000';
}
return 'DIRECT';
}
[{"product_allergens":"Puuduvad","product_volume":"kg","product_disable_discount_show":false,"small_image":"/2/7/2701384000003.jpg","tier_prices":[],"product_compare_unit_factor":"1.0000","product_compare_unit":75,"final_price":1.2416666666666667,"price":1.2416666666666667,"product_other_ean":"2710094000005","special_from_date":null,"id":"4113","product_brand":450,"sku":"T000001666","stock":{"manage_stock":false,"stock_status":1,"min_sale_qty":0.5,"item_id":4113,"min_qty":0,"use_config_min_qty":true,"qty_increments":0.5,"use_config_notify_stock_qty":true,"stock_id":1,"use_config_backorders":true,"is_in_stock":true,"max_sale_qty":10000,"backorders":false,"use_config_max_sale_qty":true,"product_id":4113,"qty":0,"use_config_enable_qty_inc":false,"enable_qty_increments":true,"is_qty_decimal":true,"use_config_manage_stock":true,"low_stock_date":null,"use_config_qty_increments":false,"notify_stock_qty":0,"use_config_min_sale_qty":false},"prices":[{"original_price":1.49,"max_price":1.49,"min_price":1.49,"final_price
@v-r
v-r / async.js
Last active April 6, 2021 10:40
async / await
const calculate = async () => {
const val1 = await getValue(1) // remote call, will take 1 sec
const val2 = await getValue(2) // remote call, will take 1 sec
const val3 = await getValue(3) // remote call, will take 1 sec
// can i get answer faster than 3 seconds ?
return va1 + val2 + val3
}
@v-r
v-r / puzzler.js
Created January 13, 2021 12:28
vaimo cms
const reducerMap = {
[actions.removeItem.receive]: (state, { count, error }) => {
// ...
if (error) {
return initialState;
}
// …
if (count => 1) {
return initialState;
[actions.removeItem.receive]: (state, { count, error }) => {
// ...
if (error) {
return initialState;
}
// …
if (count => 1) {
return initialState;
}
DELETE FROM `catalog_product_index_eav` WHERE (entity_id IN('125073', '125074', '125075', '125076', 125388))
DELETE FROM `catalog_product_index_eav` WHERE (entity_id IN('125073', '125074', '125075', '125076', 125388))
INSERT INTO `search_tmp_5cd1b4ae222eb9_22190229` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT `search_index`.`entity_id`, (((0) + (0) + (0) + (0) + (0) + (0)) * 1) AS `score` FROM `catalog_product_index_eav` AS `search_index` INNER JOIN `catalog_product_index_eav` AS `try_clothing_size_filter_filter` ON `search_index`.`entity_id` = `try_clothing_size_filter_filter`.`entity_id` AND `try_clothing_size_filter_filter`.`attribute_id` = 239 AND `try_clothing_size_filter_filter`.`store_id` = 3 INNER JOIN `catalog_product_index_eav` AS `try_shoes_size_filter_filter` ON `search_index`.`entity_id` = `try_shoes_size_filter_filter`.`entity_id` AND `try_shoes_size_filter_filter`.`attribute_id` = 267 AND `try_shoes_size_filter_filter`.`store_id` = 3 INNER JOIN `catalog_product_index_eav` AS `try_subcategory_filter` ON `search_index`.`entity_id` = `try_subcategory_filter`.`entity_id` AND `try_subcategory_filter`.`attribute_id` = 195 AND `try_subcategory_filter`.`store_id` = 3 INNER JOI
@v-r
v-r / jpaContext.xml
Created September 4, 2013 07:31
jpaConfig.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
<context:annotation-config />
<context:component-scan base-package="com.lorem.Todo" />
@v-r
v-r / gist:6428079
Created September 3, 2013 18:57
spring mvc with jpa pom
<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>
<groupId>com.Lorem</groupId>
<artifactId>Todo</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Todo Maven Webapp</name>
<url>http://maven.apache.org</url>