Skip to content

Instantly share code, notes, and snippets.

View codesprint's full-sized avatar

a.ostermeyr codesprint

View GitHub Profile
@codesprint
codesprint / webfonts.xml
Created March 13, 2015 10:59
Magento: include google webfonts
<block type="core/text" name="google.font.rosarivo">
<action method="setText">
<text><![CDATA[<link href='http://fonts.googleapis.com/css?family=Rosarivo|Cinzel:400,700' rel='stylesheet' type='text/css'>]]></text>
</action>
</block>
@codesprint
codesprint / 1.php
Created March 13, 2015 10:56
Magento: trim text
Mage::helper('core/string')->truncate($string, $length);
@codesprint
codesprint / 1.php
Created March 13, 2015 10:55
Magento: skin url in cms blocks or pages
$this->getSkinUrl('')
@codesprint
codesprint / 1.php
Last active August 29, 2015 14:17
allowed memory size exhausted
ini_set('memory_limit', '200M');
@codesprint
codesprint / 1.sh
Created March 13, 2015 10:51
wget download dir
wget -r -l0 --ftp-user=USERNAME --ftp-password=PASSWORD --directory-prefix=/Zielverzeichnis ftp://www.example.org/ordner/*
@codesprint
codesprint / 1.php
Created March 13, 2015 10:50
Magento: show table names with prefix
$tableName = Mage::getSingleton('core/resource')->getTableName('codesprint_modul');
@codesprint
codesprint / 1.php
Created March 13, 2015 10:50
Magento: show config
var_dump(Mage::getConfig());
@codesprint
codesprint / 1.sql
Created March 13, 2015 10:49
Magento: Insert command denied to user...
INSERT command denied to user 'user'@'ip' for table 'log_visitor'
@codesprint
codesprint / git.sh
Created March 13, 2015 10:47
remove deleted files from git
for i in `git status | grep deleted | awk '{print $3}'`; do git rm $i; done
@codesprint
codesprint / 1.js
Created March 13, 2015 10:46
Magento: edit Page Title via JavaScript
<script type="text/javascript" language="javascript">
document.title = "<? echo Mage::getStoreConfig('design/head/title_prefix').' '.$_product->getDUrl().' '.Mage::getStoreConfig('design/head/title_suffix'); ?>";
</script>