Skip to content

Instantly share code, notes, and snippets.

ptaferner / live_template.xml
Created Jan 16, 2016
Phpstorm: Generate pimcore translation
View live_template.xml
<template name="trans" value="&lt;?= $this-&gt;t('$TXT$') ?&gt;" description="Generate pimcore translation" toReformat="true" toShortenFQNames="true">
<variable name="TXT" expression="clipboard()" defaultValue="" alwaysStopAt="true" />
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
ptaferner /
Last active Dec 17, 2015
Create a desktop icon in Linux Mint
  1. sudo vim /usr/share/applications/YOUR-APP.desktop

  2. copy paste the following lines

[Desktop Entry]



ptaferner / pretty-data-cmd
Created Nov 30, 2015
CLI script for node modules
View pretty-data-cmd
#!/usr/bin/env node
process.stdin.on('data', function(data) {
var pd = require('pretty-data').pd;
var xml_min = pd.xmlmin(data,true);
ptaferner / conditional.xml
Last active Nov 27, 2015
In case you want non-XML-conform HTML markup based on a condition, use a construct like this:
View conditional.xml
<b:if cond='data:index in {2, 5}'>
ptaferner / AND_OR_NOT
Created Nov 27, 2015 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
ptaferner /
Created Nov 21, 2015
Manually remove a brocken debian package
# Sometimes a package does not install correctly and cannot be uninstalled either.
# All conventional commands fail like this:
# The following packages will be REMOVED:
# slapd
# Need to get 0 B of archives. After unpacking 4162 kB will be freed.
# dpkg: error processing slapd (--remove):
# Package is in a very bad inconsistent state - you should
# reinstall it before attempting a removal.
# configured to not write apport reports
ptaferner /
Created Aug 19, 2015
Installing and using multiple php versions on Debian 8.

phpfarm is a useful set of scripts which makes the installation and usage of multiple PHP versions easy and convenient. Basically, the instructions below follow the installation guidelines from the official git repository:

  • Install necessary packages for build process.
sudo apt-get install build-essential libxml2 libxml2-dev libssl-dev 
libcurl4-openssl-dev pkg-config libcurl4-gnutls-dev libjpeg-dev 
libpng12-dev libmysqlclient-dev
ptaferner / .gitignore
Last active Aug 29, 2015 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
View .gitignore
ptaferner / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console