When developing with Magento2 you have maybe come to the question were is my logger for example. This was the way in Magento before.
Mage::log('Some log message', null, 'file.log');
Maybe you have already found the logger here for example in the class Magento\Backup\Controller\Adminhtml\Index\Rollback.
$this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage());
Today I don't want to show you the logger. More interesting for me are the shared instances inside of the Objectmanager that you can use with the fucntion get.
In the last month everybody is talking about instant messenger. There are some for Firefox OS, but not really good ones. Often you are bound to one service. But with xmpp you can create your account at one of hundreds of servers all over the world. It's just a protocol. A little bit like email. My client talks to my server, my server to the server of my contact and the server of my contact with the client of my contact. You can inform your self about jabber at jabber.org. I would like to build a xmpp (jabber) app for Firefox OS. The problem: I didn't know much about xmpp and I'm not the best javascript developer. The first problem will be solved in the second part of this post, but I want to build the basic structure of the app in the first part. I did read Quick Guide For Firefox OS App Development from Andre Garzia. The book is pretty good, but like explained in the book it isn't always best practice. But it works. So I have build my app a little bit like explained in this book. At the moment I have a Alcatel One Touch Fire with Firefox OS 1.1.0.0-prerelease. The ugliest phone you can imagine, please never buy such a shit. I just use it, cause I guess Firefox OS can maybe the next revolution for mobile OS. It's pretty hard to work with such a phone if you have used a iphone since 4 years.
The most D3 examples that I can find are not responsive embedded SVG. I guess the main reason for that is not to confuse the reader of a tutorial with stuff outside of D3. With the help of How to Scale SVG from Amelia Bellamy-Royds I would like to show on a minimal D3 example how to make the resulting SVG responsive.
My project website numphp.org is based on the PHP micro framework Slim. There is no nead for a cms or blog system. I just need some static pages and a little bit of logic. My posts on numphp.org are just static html files that will be served with the php function file_get_contents. But I would like to make the posts searchable. The easy way would be a slim route for search that is just checking if the searched query is contained in every post of my blog. But in near future I would like to make also the documentation searchable. So I will use the hooks of the Slim Framework. Hooks are the same as events in other frameworks. You can throw them and listen or observe them.
Two weeks ago I could not find events in the Slim Framework so I made a Pull Requests to add a EventManager to the Framework. But before sending the Pull Request I have figured out, events are just called hooks:)
I need to illustrate 28152 different simulations in a precission and recall diagram with D3.
Lesti_Fpc has changed in the last month. Some of the changes are part of the code quality. Today I would like to present the tools, that I use to raise the quality of my Magento extension.
I just wanted to write my first Hello World extension in Magento2, but it wasn't that easy. The normal way in Magento is to create a <module>.xml in app/etc/modules. For example my extension should have the Name Lesti_HelloWorld, I would create app/etc/modules/Lesti_HelloWorld.xml with the following content:
<?xml version="1.0"?>
<config>
<modules>
<Lesti_HelloWorld>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Core/>
</depends>
</Lesti_HelloWorld>
</modules>
</config>
Just a small example for time series illustrations with D3.
I needed a C library to build a small app that triggers keyboard events in Linux. Luckily I have found xdotool by Jordan Sissel that also contains the library libxdo.
I am using Prism on my blog for my syntax highlighting and I am very happy and thankful about it. Sometimes I wanted to show the users of my blog a specific function of a class, but without decoupling the function from the class. So I needed something like a Prism plugin that can hide specific lines of the code in a foldable area.
A few days ago, I bought me an ebook reader. I need a smart solution for the 2 hours in the subway each day. I just want to learn new frameworks or any other computer things. It was clear, the reader should at first support epub format. My choice was the kobo and I'm happy with that. But were did I get my ebooks from. Sure there are a lot of (free) ebooks in the web. But I want to support the authors and I can't write a critic review of a book I never paid for. Yes, I want to pay for my books, but I will never download books with DRM and install me any Adobe shit. It's very funny, many publisher have there own books without DRM and the reseller with DRM. But there are two publisher I did like very much in the last days. The first one is leanpub.com. You get good and also very bad books for mostly 10 to 20$ in all formats without DRM. A big disadvantage and also a advantage, the author can publish the book in a nonfinished status and you never know if it will be finished. The second Publisher is packtpub.com, a good known publisher from the old paper times. I like there instant books. Just 10$ and you get a more detailed tutorial I would say. And today I would like to say a little bit about Backbone.js Application Development from Thomas Hunter II.
I am building a small python program that is waiting for input from a bluetooth device. Depending on the input of
the device I want to update my
GUI.
My decision was TkInter,
the de-facto standard GUI for Python. But my main problem was the blocking method mainloop
.
The uWave: Accelerometer-based Gesture Recognition project from the Rice Efficient Computing Group inspired me to build a small real time HTML based signature identification with JavaScript. Actually gestures have not that much incommon with drawn handwriting, but I wanted to test dynamic-time-warping on signatures. I am not sure if there is a real usecase for a signature identification in web applications, but it was fun to build this kind of prototyp. Feedback is welcome.
I am working on a small PHP library that should use some new features from PHP 7, for example scalar type declarations and return type declarations. But my current Debian 8 has only PHP 5.6.29 for me at the moment. The unstable distribution sid is no option to me and in general I try to avoid installing a specific PHP interpreter on my OS. Fortunately I need PHP only on the command line to test my library so I can use Docker to switch between the versions.
Sometimes it is necessary to compare a generated PDF file with a given one in PHP. Just to check with one PHPUnit test that your PDF generation works the expected way. But pretty often generated PDF files are equal, but there content isn't the same. For example if you use FPDF the following assertion can fail if the files have different meta data.
$pdfContent1 = file_get_contents('path_to_pdf1');
$pdfContent2 = file_get_contents('path_to_pdf2');
$this->assertSame($pdfContent1, $pdfContent2);
beastmaker Climbing Motherboard
As I bought my beastmaker Motherboard setup I was a bit upset. I did expect from the Motherboard and Grippy App somekind of digital tools to test my finger grip strength and improve it by a training plan or workout. The part with the workouts was fine. There existed a few predefined by big names of the climbing community and there was the possibility to add your owns. Unfortunately there didn't exist precise finger strengths tests as you may know them from Lattice Trainging for example. Until I opened the Grippy App yesterday.
In this post I would like to show a beastmaker backboard and training station that I build for a friend. I will tell some words about the construction, the climbing hold setup and the hangboard training app used on this board.
beastmaker Climbing Motherboard
Last week I have been using three different beastmaker Motherboards. Once at home, once at my lead climbing gym Magic Mountain and once at a local bouldering gym südbloc. My weight might be jumping from day to day a little bit and also between morning and evening, but the gap was noticeable. This was no surpise anymore after I found this Grippy post on Instagram. I am writing in this post a small tutorial based on this post to recalibrate your beastmaker Motherboards loadcell. Just in the case you may do not have Instagram and also to spread the word for this small issue.
beastmaker Climbing D3 Motherboard Time Series
In the Grippy App you are able to do freehangs and export those raw data from the beastmaker Motherboard in the CSV format. In this post I would like to go through the format and visualize the data with D3 in a time series diagram.
In the following post I want to present my adjustable home climbing wall. It may help other people by decision making, but it won't cover construction plans or similar. Everything just for boast.
Shopware best practice while developing is to use events if you want to change or add the behavior of the shop. Some developers are often searching for full event lists of a system. But in the most cases are those lists incomplete. The main reason are dynamic events. It is always a good idea to create a fresh event list for every development task that desires events.
I like to use
Gradle as building
tool for my Java Open JDK projects.
Unfortunately is there no official image available on
Docker Hub.
That is why I started to build my own Gradle image.
I would like to explain the css
and inlinecss
directives and the variable
template_styles
of Magento 2 email templates in this post.
Magento2 has reduced the use of events. I guess the Magento plug-ins are more powerful. Today I would like to show, how to create a list of all dispatched events after visiting the product page for example. I have written a similar post a few years ago for older Magento versions.
In Lesti_Fpc 1.3.2 I have added the possibility to edit the cacheTags and Parameters via an event. The idea of the Fpc was very clear and simple, but every day I get requests from developers with problems, that aren't that simple. For example oblomovx wanted to Disable Cleaning of Categories after product save. Maybe 98% of all Fpc users didn't need the possibilty to disable this functionality. Or riznmage wanted to Add AJAX parameter to make a differnce between requests that are made by ajax and normal requests. I can understand the need of such a thing, but on the other site I can't implement every crazy idea or I just think that it is wrong to make a ajax request on a action that isn't normally made for it. To let the Fpc simple, but also give those people the possiblity for there workflow I have made it like Magento. I have dispatched some events to work a little bit more advanced with the behavior of the Fpc.
The Welcome Message in Magento 1.7 is a problem for Lesti_Fpc. You can find the reason in app/design/frontend/base/default/template/page/html/header.phtml.
<!-- ... -->
<p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?></p>
<!-- ... -->
The welcome message is just a function of the header block. Lesti_Fpc needs the welcome message in a seperated block. In Magento 1.8 this is solved and the name of the block is welcome. In Magento 1.7 there is a semi-solution in core, we just have to give a little help.
Lesti_Fpc needs the name_in_layout of a block to make that block lazy or dynamic. Magento needs a unique identitfier for every block in the layout. That is the Name in Layout of a block. You can get this name with the following function.
$blockName = $block->getNameInLayout();
Or you can find the name in the layout.xml of your extensions. For example the app/design/frontend/base/default/layout/checkout.xml.
<!-- ... -->
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
<!-- ... -->
The searched attribute is name.
beastmaker Climbing Motherboard
Some weeks ago on the October 29th I joined a SmartBoard training in my local gym Magic Mountain by Jörg Helfrich. Result of the evaluation has been that my upper arms are too weak and I could improve my finger strength.
The following small trick was too simple for a post in my eyes, but too helpful in the past for not sharing. From time to time a I have a long running command in my development process, that can be compiling, evaluating data or something else that takes longer than 5 minutes. In the most cases I will focus on something else in that time and check pretty late that the command has already finished. A simple solution for me is to play some audio signal after the command has finished.
I started developing Magento 2 projects a year ago. My beloved development environment with virtualization via Vagrant was not an option anymore for such a monster application. Turning back the evolution with installing PHP and a webserver locally was not an option either. I needed something faster and Docker was that something. I made the normal Getting started tutorial and it felt good and fantastic, but I was not able to transform the learned knowledge to my current project. This is not unusual if I lern new software that has a huge field of use. It is possible to search for Put my existing application into Docker in the world wide web, but the result can be disappointing. My decision was firm, the current project has to wait until I have lerned on a more advanced but minimal project how I can integrate my project into Docker. Luckely there was the book Docker for Developers from Chris Tankersley. I can highly recommend this book for every PHP developer that needs a small introduction into Docker.
I try to avoid installing specific versions of programming language interpreters and compilers on my operating system. Project A has other requirements as project B or C and the software stack on my operating system gets more and more confusing. Luckily is it possible to run the most command line based things in a Docker container. I will try to compile and run a small Java program in a Docker container.
In the past I have written a few posts about email template directives for Magento 2.
I like to use Prism as syntax highlighter for my blog. So I have created a small grammer for Magento templates that are used for emails and for the CMS system.
It can be quite comfortable to use configuration values in Magento 2 email templates. Let us assume we change our store phone number in the configurations and it changes also in templates where we use sentences like: You can call us any time at .... I will show pretty fast in this post how to use the restricted list of configs in email templates and will explain ways to add your own configuration paths.
Lesti_Fpc is internal full page cache for Magento. This Cache needs no varnish or any other extenal software and works with events. It is an internal cache and so it replaces dynamic blocks before sending response to customer. Here is little post that explains the workflow of Lesti_Fpc.
I did start building Lesti_Fpc2. I always wanted a flexible and most compatible solution for Magento. That was never easy. So in Lesti_Fpc I did use the event controller_action_layout_generate_blocks_before as anchor. Just to explain, as anchor I mean the point were the Full Page Cache stops normal behavior of Magento and sends cached response. Normally you want to have this anchor as early as possible. My anchor was very flexible, but also not that fast as I expected.
Events in magento are very cool. Mostly events make it possible to build very modular extensions for magento. In my first steps, I always searched for a full list of magento events. The problem with these lists were, they aren't complete and outdated. And you will never find dynamic events like this.
Mage::dispatchEvent($this->_eventPrefix.'_load_after', $this->_getEventData());
I started fingerboarding with my beastmaker Motherboard setup a few month ago and I didn't thought to be that weak. It took me three tries until I was able to complete the easiest workout Beasty 5a without any mistake. Afterwards I was motivated to go on with the second easiest workout Beasty 5b. I managed the 25° Sloper set and also the 3 Finger pocket 30 mm set, but both with mistakes. But the Deep 2-finger pocket 50 mm wasn't even possible after all.
From time to time I like to spread the word for nice software that I use. As I wanted to write my own API client based on Electron, I have found Insomnia. And it has mostly every feature that I expect from an API client. Give this application a try if you build APIs every day and if you want to get rid of API client web browser plugins.
One-way bottles in germany will be thrown in the garbage after usage. Some
Docker containers will
be removed or destroyed after execution. But especially for some dependency management tools or task runners it can
be nice to have a persistent directory. We can achieve that with the parameter --volumes-from
and a
busybox.
I will show the usage on a Docker container of Composer and
Gradle, but the principle is easy to transfer for other
building or management Docker containers.
Calculations with floating point numbers are often producing small hidden bugs in some programming languages. For example rounding down or up with decimal digits. I want to show on some small examples in Java, JavaScript, Python and C the main problem.
I am a little bit interested in the possibilities of reading audio input from the web browser. So I have written a small audio noise filter based on frame wise speech / non-speech classifcation a few days ago. This filter was based on the research of the paper Quantile based noise estimation for spectral subtraction and Wiener filtering. The paper contains also an other approach, a quantile based noise spectrum estimation.
I have some old compact cassettes or tapes that I would like to digitize before time is destroying the quality completely. I will document the digitization with this post.
Bootstrap responsive embed can be very helpful to show responsive PDF files or videos. But it supports only the aspect ration 16by9 and 4by3. But what about other aspect rations? For example 210by297 would be interesting to embed a A4 paper.
Today I want to make a little review about PHP Data Persistence with Doctrine 2 ORM from Michael Romer. Like I said in a few posts ago, I just developed Magento Shops and worked with the Zend Framework. But there are so many cool libraries and frameworks for webdevelopers that I never tested. One of these things is the Doctrine Project.
"The Doctrine Project (or Doctrine) is a set of PHP libraries primarily focused on providing persistence services and related functionality."There isn't any other book outside for Doctrine. Maybe, because the documentation is very good. But I wanted a german. I know, I'm presenting the english one, but I did read the german version. If I buy a book, I expect from the author not only knowledge about the a framework or library. I also expect things like common styleguide and some practical experience. The book is published by leanpub. A very cool publisher for ebooks about IT stuff. You just have to write a ebook and can publish it over leanpub. The books will be published in the working progress, often you just have 10% of the book and it will grow. They are not that expensive, but the main problem is, the books aren't that professional.
I stared the repository of magento2 since 1 year, but I never did take a look at it. Today I wan't to change this. My current status is commit a15ecb31976feb4ecb62f85257ff6b606fbdbc00. Maybe in a few weeks all of my post isn't the latest. Let's install magento2.
In the first post I wrote a little summary of the vagrant Getting Started Documentation. But the only thing that has been working was a apache. And for my project I need also mysql and php. I did take a look at a repository of Danilo Braband who made a very cool Magento Skeleton with vagrant, n98 and composer. If you are a magento developer, take a look at it.
A few weeks ago, I wanted to build a little analytics tool. The idea was to send anonym data , to improve the performace of a magento extension (only with the permission of the shopowner). A little bit like mozilla or PhpStorm asks you after the install. But before building a static and very special webservice only for my interests, I decided to search for a tool like this. A tool that can collect requests. And I found Piwiki. A free Web Analytics Software. All I needed was a mysql database and php. I installed it after 5 minutes and was ready to check every request on my blog. I can see every visitor and can see the main problems of my website. All these datas are hosted on my server. There was also a app for my smartphone. There are many plugins for magento, wordpress and so on. I'm that happy with this tool, that I wanted to write a little post about it.
A few weeks ago a friend visited me for a session on my adjustable home climbing wall. Not only for me, especially for my friends it is sometimes difficult to remember the hand and particularly the footholds of a certain route on my home climbing wall. Unfortunately my home climbing wall has no LED system. But my friend had an alternative idea.
My nonsmoking helper application ends today after four weeks, but I would like to see the benefits of not smoking in challenging moments. So I build my own small JavaScript tool that shows me the number of not smoked cigarettes and the saved money while not smoking.
A small tool to check What is my IP address?. Plus some MaxMind GeoIP data like city, country or longitude and latitude of an IP.
I need to change the size of a PGFPlots tikzpicture in my LaTeX document. There are two different things, scaling the graphic to the full or half width for example and changing the aspect ratio of a graphic.
I need to convert all Ogg Vorbis files in a directory to MP3. I will create a small bash script that uses avconv or FFmpeg to convert the audio files.
A few days ago I have written a small post about Reading Web Audio API with JavaScript. But no matter how silent I am acting on my working place, my computer is always producing the following noise.
I will try to create a small lightweight noise spectrum estimation and elimination filter in JavaScript that is based on the research of Quantile based noise estimation for spectral subtraction and Wiener filtering.
I have started the development of my own Prism theme. I was mostly inspired by the awesome Prism theme of Mozilla Developer Network. I thought it would be difficult, but in general it is just defining some colors. The theme is also used by blog.
There are two logical directives that can be used in Magento 2 email templates. The depend
and the
if
directives. I will explain both in this post.
Unfortunately it is not possible to create a real blur overlay with CSS for all browsers at the moment. Only webkit
has the backdrop-filter. But all other browsers mostly
support a blur filter. This will not really work like a overlay, more like a filter that will be propagated
bottom-up. In other words, the filter works only for a hole element or not. It's impossible to have something like a
div
overlay element that blurs only a part of an image like the backdrop-filter
.
I use a small Docker image for the development with Magento2. But unfortunately I got a 503 error after every start of the container.
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
The problem was really homemade. My setup script tries to install Magento on every start of the container. But that leads me to the point to take a small look at the maintenance mode of Magento2.
Finally I'm at the end. These are the tings I have done before I now can start installing ownCloud on my Raspberry Pi.
The current version of ownCloud is 8.2.2 and this version would be better, cause it has full PHP7 support. But I will now install 8.1, cause there are some problems with 8.2.2 and the calendar app does not support PHP7 at the moment. But ownCloud 9 will come soon in 2016. The last time I have installed ownCloud is a while ago and so I will start with Manual Installation on Linux.Chrome Firefox Linux VirtualBox Windows
When downloading a virtual machine at https://dev.windows.com/en-us/microsoft-edge/tools/vms/ I'm always getting a Unknown network error from my browser, in this case chromium. But I had the same experience with iceweasel.
A little bit special today, but I would like to show how to rotate every second page of every PDF file in a directory. This mostly happends if you scan a book for example and that looks something like this after scanning.
On my Wordpress blog I had a page for donations. It didn't happend that often, but when somebody wanted to spend some money for my small open source projects I always send a link to a page like this. A list of awesome software projects that I use every day. All these projects need some money or help. The donation page doesn't exist anymore, so I have created this small post that will be updated from time to time.
From the 7th to the 8th March 2015 was the Magento Unconference 2015 #mageuc15. Unfortunately I have missed the pre-party at Friday, but I heard it was quite funny. I have been arrived at Saturday morning. Every participant had the opportunity to suggest a topic that he is interested in. It was a cool mix, for example Avoiding Burnout, Magento Search or Module testing. Sometimes it was a presentation, sometimes a discussion or a mix of both. It was a real community event.
I have noticed more and more links to commercial Magento extensions in the comments of my blog. That is pretty normal, cause my Magento extensions aren't free of conflicts with other extensions and people just want to give me a hint. But sometimes I'm not sure if they just want to ask a stupid question and make their link. SEO isn't my hot topic. Everything I know is, good content and backlinks are important. I always visit the website of an comment and sometimes I remove their link to an commercial Magento extension shop. But I would like to disable the links in the comments. So I have decided to make all links in comments not clickable.
Since two years I wasn't on any magento confernce. That's mostly because I'm a student and I haven't
enough money for big conferences. So today I would like to promote the
Mage Unconference 2015
and this post is my contribution. The conference will happen at 7th and 8th March 2015 in Berlin. I have my
ticket and it would be pretty cool to meet some people from the magento community, that I only know from
there github avatars.
Pencil is a pretty nice open-source GUI prototyping tool. The only little problem for Debian user is, Pencil depends on Firefox and not on Iceweasel. If you want to bypass that problem very easy, you can download pencil as Firefox Extension. But if you want to use Pencil as native application you have to download the deb package and will see, that it depends on Firefox. Iceweasel and Firefox are the same things, but have different names.
Here is a Wikipedia articel about Mozilla Corporation software rebranded by the Debian project.You can run dpkg also with --ignore-depends=firefox, but that isn't a very good solution.
My new ZTE Open C arrived and I just wanted to share some pictures. The last 3 month I used the Alcatel One Touch Fire and it's a difference, like night and day. I have ordered it over the german ebay-shop of zte and I'm happy about my new 85€ smartphone.
The current Magento2 version is 2.0.0.0-dev45 and I would like to build a simple HelloWorld! extension. I guess the current version isn't that different to Magento1 and maybe it doesn't make that much sense to write this right now, but I just want to show the little difference in this moment.
Since version 1.1.1 of Lesti_Fpc I get more support requests for the layered navigation. I did change the behavior of key generating in Lesti_Fpc to get more hits in the cache. I added the new field Uri Params in the configurations and wrote a post about it. This post is all you need to get your layered navigation work, but I guess it would be better to explain it again an example.
Two weeks ago, I did get my first bad review on magento connect. The review was for the extension Lesti::Smtp. I can't say how frustrating it was for me. I guess I'm able to take criticism and I know it looks very childish to write a post about it, but I just want say my oppinion about it. Here can you see the review of digisiil.
Magento dependencies are quite easy to understand. One Extension needs an other extension. For example Mage_Page needs Mage_Core. But does it really make sense?