Skip to content

Instantly share code, notes, and snippets.

View jaromirmuller's full-sized avatar

Jaromír Müller jaromirmuller

View GitHub Profile
@jaromirmuller
jaromirmuller / Url.php
Created October 18, 2014 19:25
checkout/bag url rewrite
class Getready_Rewrite_Model_Core_Url extends Mage_Core_Model_Url {
/**
* Build url by requested path and parameters
*
* @param string|null $routePath
* @param array|null $routeParams
* @return string
*/
public function getUrl($routePath = null, $routeParams = null) {
[7, "/v1.0/pubsub/tablet/status", "{\"dt\":2,\"t_sn\": \"TABLET_1\",\"ec\": 1,\"bs\": 30,\"sw\": \"newsw-1.2.3\"}"]
[7, "/v1.0/pubsub/station/status", "{\"dt\":1,\"cs_sn\":\"STATION\",\"sc\":10,\"tl\":[{\"so\":1,\"tf_sn\":\"TABLET_1\",\"s\":1}],\"ec\":1,\"sw\":\"cs-1.2.3\",\"log\":{\"msg\":\"any message\"}}"]
@jaromirmuller
jaromirmuller / J50Npi.js
Last active December 19, 2015 14:29
JSONP Client sample implementation for Session Initialization flow.
var J50Npi = {
currentScript: null,
getJSON: function(url, data, callback) {
var src = url + (url.indexOf("?")+1 ? "&" : "?");
var head = document.getElementsByTagName("head")[0];
var newScript = document.createElement("script");
var params = [];
var param_name = ""
this.success = callback;
#!/bin/sh
php indexer.php --reindex cataloginventory_stock
php indexer.php --reindex catalog_product_attribute
@jaromirmuller
jaromirmuller / scope.template.yaml
Last active December 19, 2015 01:19
phpunit / yaml / fixtures
scope:
website: # Initialize websites
- website_id: 2
code: nsc_website
name: NoStress Website
default_group_id: 2
group: # Initializes store groups
- group_id: 2
website_id: 2
name: NoStress Store Group
vector<int>* MatchingVertices(int **G, Node *T, vector<int> *V_used) {
int i, j, k, deg, DEG = 2 * (n_net - 1);
vector<int> V_cand;
vector<int> V_label;
vector<int>::iterator it, itx;
vector<int> * Vertices = new vector<int>();
vector<std::set< pair<int, int> > >::iterator it_cv;
std::set< pair<int, int> >::iterator it_cs;
int label_min, L;
@jaromirmuller
jaromirmuller / create_index.sh
Created December 2, 2012 10:17
ES Create Testing Index
curl -XDELETE 'http://localhost:9200/test_index/'
curl -XPUT 'http://localhost:9200/test_index/' -d '{"number_of_shards":4,"number_of_replicas":1,"analysis":{"analyzer":{"indexAnalyzer":{"type":"custom","tokenizer":"standard","filter":["lowercase","mySnowball"]},"searchAnalyzer":{"type":"custom","tokenizer":"standard","filter":["standard","lowercase","mySnowball"]}},"filter":{"mySnowball":{"type":"snowball","language":"German"}}}}'
curl -XPUT 'http://localhost:9200/test_index/test_type/_mapping' -d '{"test_type":{"index_analyzer":"indexAnalyzer","search_analyzer":"searchAnalyzer","_boost":{"name":"_boost","null_value":1},"properties":{"sku":{"type":"string","_boost":1,"include_in_all":true,"index":"not_analyzed"},"name":{"type":"string","_boost":2,"include_in_all":true},"price":{"type":"float","_boost":1,"include_in_all":true,"index":"not_analyzed"},"description":{"type":"string","_boost":1,"include_in_all":true},"yesno":{"type":"string","_boost":1,"include_in_all":true,"index":"not_analyzed"},"size":{"typ
@jaromirmuller
jaromirmuller / gist:3849333
Created October 7, 2012 19:35
Mage_Tax_Model_Calculation::getRateRequest
class Mage_Tax_Model_Calculation extends Mage_Core_Model_Abstract
{
/** there is many methods **/
/**
* Get request object with information necessary for getting tax rate
* Request object contain:
* country_id (->getCountryId())
* region_id (->getRegionId())