Skip to content

Instantly share code, notes, and snippets.

@davefreiman
davefreiman / setup.md
Last active November 12, 2018 13:23
Elasticsearch docker setup

Make sure to login to docker hub before getting started

$ docker login

# pull repo from docker hub
$ docker pull elasticsearch:latest

# run the container
# --name option is the reference for the container so that you can start and stop it after the initial run

-p option are the ports to map the running container to. I use 127.0.0.1:9200 explicitly and supply :9200 as an extra precaution.

@davefreiman
davefreiman / dependency-setup.md
Last active January 15, 2018 18:21
mongo setup
$ docker pull mongo:3.4
$ docker run --name mongo_3_4 -p 127.0.0.1:27017:27017 -d mongo:3.4

$ docker pull redis:latest

$ docker run --name redis_latest -p 127.0.0.1:6379:6379 -d redis:latest

Keybase proof

I hereby claim:

  • I am davefreiman on github.
  • I am dfreiman (https://keybase.io/dfreiman) on keybase.
  • I have a public key whose fingerprint is 8A1C 70A4 BCF5 4FFA 8428 9ACE C538 0384 B7F7 D087

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am dfry22 on github.
  • I am dfreiman (https://keybase.io/dfreiman) on keybase.
  • I have a public key ASCTh8iz8GVe8opXyYCDLTqRLT5G3ZVQd00m6vypzPJsago

To claim this, I am signing this object:

<?xml version="1.0"?>
<config>
<global>
<!--...-->
<session_save><![CDATA[db]]></session_save>
<redis_session> <!-- All options seen here are the defaults -->
<host>127.0.0.1</host> <!-- Specify an absolute path if using a unix socket -->
<port>6580</port>
<password></password> <!-- Specify if your Redis server requires authentication -->
<timeout>2.5</timeout> <!-- This is the Redis connection timeout, not the locking timeout -->
@davefreiman
davefreiman / rewrites_output
Created April 19, 2015 19:46
Output of script that scanned ~6000 Magento Connect extensions for all their listed rewrites - with help from triplecheck.io
{
"blocks":{
"sales_order_grid":110,
"sales_order_view":67,
"html_head":55,
"comment":51,
"catalog_product_grid":38,
"product_view":34,
"onepage":32,
"onepage_payment_methods":30,
➜ triplecheckio git:(master) ✗ php parserecords.php
email_template => Dolist_Net_Model_Dolistemt_Email_Template
email_template => FreeLunchLabs_MailGun_Model_Email_Template
email_template => Strategery_GmailInboxActions_Model_Email_Template
email_template => Yireo_EmailOverride_Model_Email_Template
email_template => Whiteimage_Whitesync_Model_Email_Template
email_template => Engine_Engine_Model_Core_Email_Template
email_template => Janolaw_Agb_Model_Email_Template
email_template => Mxm_AllInOne_Model_Transactional_Email_Template
email_template => Sendgrid_Mailtransport_Model_Email_Template
<?php
$_product = $this->getProduct();
$_helper = $this->helper('catalog/output');
?>
...
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li>
<a href="#" title="<?php echo $this->escapeHtml($_image->getLabel()) ?>">
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />
</a>
/**
* Retrieve route URL
*
* @param string $routePath
* @param array $routeParams
*
* @return string
*/
public function getRouteUrl($routePath = null, $routeParams = null)
{
public function run()
{
if ($this->getArg(0)) {
$profileId = $this->getArg(0);
}
if (isset($profileId)){
$profile = Mage::getModel('dataflow/profile');
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(0);