Skip to content

Instantly share code, notes, and snippets.

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@R11baka
R11baka / behat.yml
Created October 2, 2013 08:15
behat.yml in macos
# behat.yml
default:
extensions:
Behat\MinkExtension\Extension:
goutte: ~
show_cmd: '/Applications/Firefox.app/Contents/MacOS/firefox %s'
formatter:
name: pretty
parameters: ~
paths:
@R11baka
R11baka / JsonContext.php
Created October 10, 2013 12:37
Print failded response when behat step failed
/**
* print failed response
* @AfterStep
*/
public function printFaildeResponse($event)
{
if (self::INVALID_STEP_CODE === $event->getResult()) {
$this->echoLastResponse();
}
}
@R11baka
R11baka / uglifyJsCss.pp
Created July 10, 2014 09:12
Install uglifyJs,and uglifyCss by puppet on CentOs
# instal minify
package { 'uglify-js':
ensure => installed,
}
# install nodejs package manager
package{ "npm":
ensure => installed
}
@R11baka
R11baka / uglify.pp
Created July 10, 2014 09:12
Install uglifyCss and uglifyJs by puppet on CentOs
# instal minify
package { 'uglify-js':
ensure => installed,
}
# install nodejs package manager
package{ "npm":
ensure => installed
}
$email = new SendGrid\Email();
$email->setFrom(APP_FEEDBACK_EMAIL)
->setSubject('TEST EMAIL FROM STANDALONE BDAYCARDS')
->addFilter('subscriptiontrack', "enable", 1)
->addFilter(
'subscriptiontrack',
"text/html",
"If you would like to unsubscribe and stop receiving these emails <% click here %>."
)
->addFilter('subscriptiontrack','replace','[unsubscribe_link]');
@R11baka
R11baka / DeployVersion.php
Created August 29, 2014 14:13
Symfony2 buildnumber in footer
use JMS\DiExtraBundle\Annotation\Inject;
use JMS\DiExtraBundle\Annotation\InjectParams;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\Tag;
use Twig_Extension;
/**
* @Service()
* @Tag("twig.extension")
@R11baka
R11baka / javascript_resources.md
Last active August 29, 2015 14:16 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@R11baka
R11baka / css_resources.md
Last active August 29, 2015 14:16 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@R11baka
R11baka / Install nodejs on CentOs
Created January 25, 2016 14:47
Install nodejs on CentOs
$ wget https://raw.github.com/isaacs/nave/master/nave.sh
$ chmod +x nave.sh
$ ./nave.sh install 5.1.0
$ ./nave.sh use 5.1.0
$ node -v