Skip to content

Instantly share code, notes, and snippets.

View dng-dev's full-sized avatar

Daniel Niedergesäß dng-dev

View GitHub Profile
@dng-dev
dng-dev / Setup.php
Created February 7, 2014 23:33
Magento Store Based EAV Entity Tables Setup Model
final class Dng_Customeav_Model_Setup extends Mage_Eav_Model_Entity_Setup
{
/**
* create store based eav entity tables
*
* @param string $baseName
* @param array $options
* - (bool) no-main don't create entity main table
* - (bool) no-default-types don't create default types
* - (array) types valid Types or custom types

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@dng-dev
dng-dev / chef.rb
Last active September 11, 2015 15:09 — forked from assimovt/chef.rb
Chef cookbook
# cookbooks/chef/attributes/chef.rb
set_unless[:chef][:log_location] = "STDOUT"
set_unless[:chef][:log_level] = "info"
set_unless[:chef][:url_type] = "http"
set_unless[:chef][:server_fqdn] = "your-chef-server"
set_unless[:chef][:server_port] = "4000"
set_unless[:chef][:validation_client_name] = "chef-validator"
set_unless[:chef][:cache_path] = "/var/cache/chef"
@dng-dev
dng-dev / dna.json
Last active September 13, 2015 10:50 — forked from fnichol/dna.json
Example webapp server configured with chef-solo dna.json
{
"webapp": {
"web_server": "apache2",
"vhosts": [
{ "id": "production",
"host_name": "main.example.com",
"non_ssl_server": true,
"www_redirect": false,
"ssl_server": true,
"ssl_www_redirect": false

Magento Scaling Hypotheses

Magento’s checkout throughput can increase to at least 8 times its current capacity and up to 26 times more in ideal conditions.

  1. The current checkouts per hour limit for large, real-world Magento stores is 4,500
  2. This limit cannot effectively be increased with more and/or better hardware
  3. The improper type handling in Magento’s SQL code is the cause of the current limit
  4. If one SQL query is fixed, large Magento stores can scale to a new, real-world limit of 120,000 checkouts per hour
  5. For commodity hardware, this new limit might be 36,000 checkouts per hour
@dng-dev
dng-dev / opcache.ini
Created October 17, 2015 23:42 — forked from tegansnyder/opcache.ini
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
@dng-dev
dng-dev / LICENSE
Created October 18, 2015 01:39 — forked from ifraixedes/LICENSE
AWS lambda handler which download images from S3, resizes them and upload the new ones to S3; tested with mocha, chai, sinon and proxyquire
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
(http://www.wtfpl.net/about/)
Copyright (C) 2015 Mario Mendes (@hyprstack)
Copyright (C) 2015 Ivan Fraixedes (https://ivan.fraixed.es)
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
http://redisdesktop.com/download
http://www.sequelpro.com/
@dng-dev
dng-dev / bgd-php.template
Created November 6, 2015 21:51 — forked from miyamoto-daisuke/bgd-php.template
AWS CloudFormation tempate for PHP Blue-Green Deployment environment
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "PHP Blue-Green Deployment environment template",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
"MinLength" : "1",
"MaxLength" : "64",
"AllowedPattern" : "[-_ a-zA-Z0-9]*",