Skip to content

Instantly share code, notes, and snippets.

View toh82's full-sized avatar

Tobias Hartmann toh82

View GitHub Profile

Keybase proof

I hereby claim:

  • I am toh82 on github.
  • I am toh (https://keybase.io/toh) on keybase.
  • I have a public key ASCgMFcQaeFMYlinxGNU86MNCdOATxDEjxXkEP4dW7_aVAo

To claim this, I am signing this object:

@toh82
toh82 / terminal_commands.md
Last active December 7, 2017 14:43
Collection of Terminal commands

Symlinks

  • ln -sfn [linkbase] [linktarget] Makes a symbolic link and if the link already exists it creates it with the new options. This does not work for files since the n parameter stand fpr directory.

Database

  • mysqldump -u root -p [DB-NAME] | gzip > [DB-NAME].sql.gz dump a DB and gzip it.
  • zcat [DB-NAME].sql.gz | mysql -u root -p [DB-NAME] import a gzipped dumb to DB.

Git

  • git clone [repo url] --branch [branch name] to clone a repo with a specific branch
#!/bin/bash
apt-get update
echo
echo "Installing git"
echo "-----------------------------------------"
echo
sudo apt-get install -y git

After 10 years of handcrafting web design and frontend coding, I started heavily working with javascript, css preprocessors and Magento about 4 years ago. Starting as a junior frontend developer at a big company, I made my way through smaller design agencies as a technical project lead, frontend concept engineer, designer and developer. As a trained designer and mainly self-learned frontend coder, I really enjoy the powers of both worlds and love to combine them to make awesome projects. Nowadays I work as a frontend lead developer for e-commerce projects at Sitewards. I love contributing to open source projects and community work in general because of the huge amount of power which a community can share. My strengths are solving structural issues with HTML and stylesheets, writing ass kicking styles, developing user interfaces in javascript and I’m also good at designing user interfaces for apps and shops.

How to deal with styles in Magento 2
We all know, Magento 2 introduced a new framework for frontend styling with less and grunt.
All the shiny new technologies, we learned to love for our frontend development in Magento 1
and it has a built-in compiling process, too — doesn’t this sound stellar?
In this talk we'll investigate why it could be good or why bad, to learn this new Magento 2 framework,
instead of trying to bend the system to the process we're comfortable with.

@toh82
toh82 / InstallHelper.php
Last active August 29, 2015 14:26
Magento EE Customer Attributes Install-script
<?php
class Project_Customer_Helper_Install extends Mage_Core_Helper_Abstract
{
/**
* @param string $sEntityIdentifier
* @param string $sAttributeIdentifier
* @param string $sSortOrder
* @throws Mage_Core_Exception
*/
@toh82
toh82 / setup.js
Last active August 29, 2015 14:26
Extend Magento RTE with HTML 5 Tags
(function (getSettings) {
/**
* change standard behavior to not wrap code into <p>-tag
* and add some html5 tags
*
* @param mMode
* @returns {object}
*/
tinyMceWysiwygSetup.prototype.getSettings = function (mMode) {
var oSettings = getSettings.call(this, mMode);
@toh82
toh82 / update_cms_page.php
Created July 30, 2015 08:55
Updating Magento CMS Pages
/** @var Mage_Cms_Model_Page $oMagePageModel */
$oMagePageModel = Mage::getModel('cms/page');
foreach ($aHomePageTeaserContent as $iStoreId => $sHomePageTeaserContent) {
$iPageId = $oMagePageModel->checkIdentifier('home', $iStoreId);
$oPage = $oMagePageModel->load($iPageId);
$sPagePrevContent = $oPage->getContent();
$oPage->setData('stores', array($iStoreId));
@toh82
toh82 / data-script.php
Last active August 29, 2015 14:26
Install Script for Magento static blocks
<?php
/** @var Mage_Cms_Model_Block $oLoadedCmsBlock */
$oCmsBlockModel = Mage::getModel('cms/block')->setStoreId($aBlockData['stores'])->load($aBlockData['identifier']);
$bDoesStoreMatchCurrentBlockStore = $aBlockData['stores'] === (int)$oCmsBlockModel->getStoreId()[0];
if($oCmsBlockModel->getId() && $bDoesStoreMatchCurrentBlockStore) {
// update block
$oCmsBlockModel->setContent($aBlockData['content']);
} else {
// save new block
@toh82
toh82 / moduleLauncher.js
Last active August 29, 2015 14:25
JS Module Launcher
(function ($) {
var moduleLauncher = {
oSettings: {
prefix: 'js_',
moduleRegister: [],
debug: false
},
/**
* Method to print out debug information