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
@behrendtio
behrendtio / gist:1199768
Created September 7, 2011 04:27
Jenkins Email-ext Jelly script
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<BODY>
<B>Build wurde mit dem Ergebnis <I>${build.result}</I> abgeschlossen.</B><BR/>
Dauer: ${build.durationString}.<BR/><BR/>
<TABLE>
<TR><TD><B>Konsolenausgabe</B></TD></TR>
<j:forEach var="line" items="${build.getLog(100)}">
<TR><TD>${line}</TD></TR>
</j:forEach>
@behrendtio
behrendtio / gist:1217098
Created September 14, 2011 17:00
Amazon EC2 Root login
sudo cp -rv /home/ec2-user/.ssh /root/
# /etc/ssh/sshd_config
# Change
PermitRootLogin forced-commands-only
# To
PermitRootLogin yes
sudo service sshd reload
@behrendtio
behrendtio / gist:1236977
Created September 23, 2011 08:54
Ecomdev_PHPUnit Error
<?php
// PHP Fatal error: Call to a member function getFrontNameByRoute() on a non-object in /var/www/magento-testing/magento/app/code/core/Mage/Core/Controller/Varien/Front.php on line 199
// Seems like $routesinfo does not contain admin and standard
// Mage_Core_Controller_Varien_Front
// This hack would work:
$routersInfo = Mage::app()->getConfig()->getNode('default/web/routers')->asArray();
@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>
@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

[{
"requestKey": "XX1",
"method": "create",
"entity": "coupon",
"body": { "title": "bloopark discount 10%" }
}, {
"requestKey": "XX2",
"method": "create",
"entity": "coupon",
"body": { "title": "bloopark discount 20%" }
[{
"requestKey": "XX2",
"code": 1000,
"body": { "id": "5" }
}, {
"requestKey": "XX1",
"code": 1000,
"body": { "id": "6" }
}]
[{ "requestKey": "jds", "entity": "coupon", "method": "create", "body": { "foo": "bar" }},]
@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()
}
});
@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