Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0"?>
<config>
<global>
<models>
<core>
<rewrite>
<translate>TJU_Core_Model_Translate</translate>
</rewrite>
</core>
</models>
@yevgenko
yevgenko / view.phtml
Created April 17, 2010 03:00
Tinycarts_Debug_Firephp usage example
<?php
// Tinycarts_Debug_Firephp usage example
Tinycarts_Debug_Firephp::send($this->debug(), 'Product view page aka view.phtml VAR: $this');
Tinycarts_Debug_Firephp::send($_product->debug(), 'Product view page aka view.phtml VAR: $_product');
<?php
$this->widgetSchema['captcha'] = new sfWidgetFormReCaptcha2(array(
'public_key' => sfConfig::get('app_recaptcha_public_key')
));
<config>
<modules>
<TJU_Core>
<active>true</active>
<codePool>local</codePool>
</TJU_Core>
</modules>
</config>
@yevgenko
yevgenko / email.sh
Created April 17, 2010 02:42
script to override email templates in Magento
#!/bin/sh
phone='(XXX) XXX-XXXX'
email='example@example.com'
basedir='app/design/frontend/tjuInterface/default'
find $basedir/locale/en_US/template/email/sales -type f -exec sed -i 's/alt="Magento"/alt="{{var order.getStoreGroupName()}}"/g' '{}' \;
find $basedir/locale/en_US/template/email/sales -type f -exec sed -i 's/Magento Demo Store/{{var order.getStoreGroupName()}} /g' '{}' \;
find $basedir/locale/en_US/template/email/sales -type f -exec sed -i 's/Demo Store/{{var order.getStoreGroupName()}} /g' '{}' \;
find $basedir/locale/en_US/template/email/sales -type f -exec sed -i "s/mailto:magento@varien.com/mailto:$email/g" '{}' \;
find $basedir/locale/en_US/template/email/sales -type f -exec sed -i "s/dummyemail@magentocommerce.com/$email/g" '{}' \;
<?php
class sfWidgetFormReCaptcha2 extends sfWidgetFormReCaptcha
{
/**
* @see sfWidgetFormReCaptcha
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
$server = $this->getServerUrl();
<?php use_javascript('http://api.recaptcha.net/js/recaptcha_ajax.js') ?>
@yevgenko
yevgenko / Firephp.php
Created April 17, 2010 02:57
FirePhp wrapper for magento
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@yevgenko
yevgenko / gist:380491
Created April 27, 2010 08:21
simultaneous spell checking for Russian and English
#!/usr/bin/perl -ln
# aspell wrapper to have spell checking simultaneously for Russian and English
# from http://powerman.name/config/vim.html
# put this code into ~/bin/aspell and make executable
BEGIN {
($OPT = " @ARGV ") =~ s/\s+-d\s+\w+//g;
$IS_APPEND = $OPT =~ /\s-a\s/;
@ARGV = ('-');
umask 077;
open $R,"| /usr/bin/aspell $OPT -d russian --ignore-accents >/tmp/aspell_ru.$$";
## from libcloud.types import Provider
## from libcloud.providers import get_driver
require 'fog/types'
require 'fog/providers'
## EC2 = get_driver(Provider.EC2)
## Slicehost = get_driver(Provider.SLICEHOST)
## Rackspace = get_driver(Provider.RACKSPACE)
EC2 = Fog::Provider.new(:ec2) # syntax 1