This file contains 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
const people = [{ | |
name: 'Homer', | |
role: 'parent', | |
gender: 'male', | |
hobby: 'drinking beer' | |
}, { | |
name: 'Marge', | |
role: 'parent', | |
gender: 'female', | |
hobby: 'talking to sisters' |
This file contains 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
// 1. navigate to https://coinmarketcap.com/all/views/all/ | |
// 2. open console (F12) | |
// 3. insert this script and hit enter | |
// 4. currencies which are not in the shapeShiftCurrencies array should be hidden | |
// 5. optional: run this script again and it will show back the currencies. | |
$('.no-wrap.currency-name').each(function() { | |
const shapeShiftCurrencies = [ | |
'Bitcoin', | |
'Ethereum', |
This file contains 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
#!/usr/bin/env bash | |
exec $ES_HOME/bin/elasticsearch "$@" | |
echo 'waiting for elasticsearch server to come up...' | |
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:9200); do | |
printf '.' | |
sleep 2 | |
done | |
./$ES_HOME/createMappings.sh |
This file contains 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
GET /masterproducts/product/_search | |
{ | |
"query": { | |
"bool": { | |
"must": [{ | |
"term": { | |
"product._all": "zem" | |
} | |
}], | |
"must_not": [], |
This file contains 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
input { | |
tcp { port => 9292 type=>"sample" } | |
} | |
filter { | |
json { | |
source => "message" | |
} | |
} |
This file contains 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
POST /products | |
{ | |
"settings": { | |
"analysis": { | |
"filter": { | |
"nGram_filter": { | |
"type": "nGram", | |
"min_gram": 2, | |
"max_gram": 20, | |
"token_chars": [ |
This file contains 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
{ | |
"_id" : ObjectId("53e87e239ae974e6a0a81004"), | |
"name" : "www.example.com", | |
"products" : [ | |
{ | |
"name" : "apple", | |
"status" : 1 //this got updated from 0 to 1 | |
}, | |
{ | |
"name" : "banana", |
This file contains 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
{ | |
"_id" : ObjectId("53e87e239ae974e6a0a81004"), | |
"name" : "www.example.com", | |
"products" : [ | |
{ | |
"name" : "apple", //lets say the name key here is primary key of products | |
"status" : 0 | |
}, | |
{ | |
"name" : "banana", |
This file contains 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
/* | |
Toto je pseudo kod ku hadanke ako logicky zistit ktora z dvanastich guliciek ma inu vahu ako vsetky ostatne gulicky. | |
Gulicky sa mozu odvazit dokopy 3x na vahe. | |
*/ | |
var gulicky = [0,1,2,3,4,5,6,7,8,9,10,11]; | |
var specialGulicka = Math.floor(Math.random() * 11) + 0; | |
var vazenia = 3; | |
var viemKtoraGulicka = false; | |
var viemVktorejSkupineJeAsiGulicka = false; |
This file contains 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
<?php | |
/** | |
* This script is meant to be run from terminal or command line | |
*/ | |
error_reporting(E_ERROR | !E_WARNING | E_PARSE); | |
$dom = new DOMDocument(); | |
if (!$dom->loadHTMLFile('http://www.pixmania.co.uk/roadworks/playmobil-4820-ladder-unit/04373247-a.html')) { | |
die("there was an error downloading the product page, now exiting..."); |