Skip to content

Instantly share code, notes, and snippets.

View behrendtio's full-sized avatar

Mario Behrendt behrendtio

  • @tails.com
  • London, United Kingdom
View GitHub Profile

Keybase proof

I hereby claim:

  • I am behrendtio on github.
  • I am behrendtio (https://keybase.io/behrendtio) on keybase.
  • I have a public key ASBuPy1P3GnLU9GI_M2oJCotIadP5sWqbeK5BcBo2S5xMwo

To claim this, I am signing this object:

@behrendtio
behrendtio / gist:27a18cfef9327b72a5d9
Last active August 29, 2015 14:19
Logstash docker
input {
tcp {
port => 5000
type => syslog
}
udp {
port => 5000
type => syslog
}
}
@behrendtio
behrendtio / gist:5850947
Last active December 18, 2015 21:59
Shopify problem

My client reported the following issue:

He has multiple products for the vendor "Double RL", like those two:

As you can see on the detail pages, the vendor link is the same (above the product name). Yet, when opening the vendor's product list, the white sweater doesn't show up (check the bottom for the grass one). In fact there're multiple products missing. The same behaviour in the backend. When filtering the product list for this particular vendor, multiple products are missing, basically all the related ones here:

http://www.e35shop.com/products/double-rl-sweat-crew-neck-fleece-solid-faded-grass

@behrendtio
behrendtio / gist:5779239
Last active December 18, 2015 11:59
Shopify explanation

VAT: 20%

Price including VAT: 35 €

Price excluding VAT: 29.17 €

Calculating incl. VAT using {{ price | times: 1.2 | money }}

  • for 1 item: 35 € ==> correct
  • for 2 items: 70.01 € ==> incorrect
@behrendtio
behrendtio / mongoose.js
Created September 30, 2012 14:47
Mongoose date thing
var mongoose = require('mongoose');
var db = mongoose.createConnection('localhost', 'test');
var TestSchema = mongoose.Schema({
createdAt: {
type: 'date',
default: new Date()
}
});
[{ "requestKey": "jds", "entity": "coupon", "method": "create", "body": { "foo": "bar" }},]
[{
"requestKey": "XX2",
"code": 1000,
"body": { "id": "5" }
}, {
"requestKey": "XX1",
"code": 1000,
"body": { "id": "6" }
}]
[{
"requestKey": "XX1",
"method": "create",
"entity": "coupon",
"body": { "title": "bloopark discount 10%" }
}, {
"requestKey": "XX2",
"method": "create",
"entity": "coupon",
"body": { "title": "bloopark discount 20%" }
@behrendtio
behrendtio / gist:2260890
Created March 31, 2012 08:37
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@behrendtio
behrendtio / gist:1244714
Created September 27, 2011 09:53
PHPUnit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit convertErrorsToExceptions="true" convertNoticesToExceptions="true"
convertWarningsToExceptions="true" stopOnFailure="false" backupGlobals="false" syntaxCheck="true" colors="true">
<testsuite name="Test Suite">
<directory>./</directory>
</testsuite>
<filter>
<whitelist>
<directory suffix=".php">.</directory>