Skip to content

Instantly share code, notes, and snippets.

@ivanweiler
ivanweiler / app_etc_local.di.xml
Last active April 18, 2017 07:45
Magento 2 log database queries
<?xml version="1.0"?>
<!--
/**
* Log Db Queries
* Copy to /app/etc/local.di.xml (di.xml glob follows {*di.xml, */*di.xml} pattern)
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Framework\DB\LoggerInterface" type="Magento\Framework\DB\Logger\File"/>
<type name="Magento\Framework\DB\Logger\File">
@avoelkl
avoelkl / checks.md
Last active June 16, 2016 17:09
PayPal Security Update on June 17th 2016

So, here's the thing: PayPal is rolling out a security update on June 17th 2016. A friday, for the joy of all developers and agencies I think. Those who are not prepared and did not check the requirements first will have websites/shops with a non-working PayPal integration after June 17th.

The main 2 points are:

Support SHA-256

PayPal is upgrading SSL certificates on all Live and Sandbox endpoints from SHA-1 to the stronger and more robust SHA-256 algorithm. You will need to update your integration to support certificates using SHA-256.

Discontinue use of the VeriSign G2 Root Certificate

@ivanweiler
ivanweiler / Mage_Checkout_Block_Onepage_Billing.php
Created June 17, 2015 10:00
Magento Checkout - fill address forms from Quote address (if possible) for guest customers
/**
* Mage_Checkout_Block_Onepage_Billing::getAddress() should be something like this
*
* Similar for Mage_Checkout_Block_Onepage_Shipping
*/
public function getAddress()
{
if (is_null($this->_address)) {
$this->_address = $this->getQuote()->getBillingAddress(); //always take address from quote
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@Marko-M
Marko-M / gist:10931ff5e990431b5410
Last active August 14, 2018 02:51
Stored procedure - drop all tables [MySQL]
DELIMITER //
CREATE PROCEDURE dropAllTables()
--
-- dropAllTables
-- Date: 2014-05-26
-- Author: Andrew Cassidy <andrew@cassidywebservices.co.uk>
-- Author: Marko Martinović <marko@techytalk.info>
--
-- This Stored Procedure loops over the tables in the current database and
-- drops them.
@alexstone
alexstone / slack_notification.php
Created March 3, 2014 06:54
Fire a Slack Notification via CURL
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = "payload=" . json_encode(array(
"channel" => "#{$room}",
"text" => $message,
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@xeoncross
xeoncross / example.php
Created June 25, 2012 19:40 — forked from anothergituser/ioc.php
PHP 5.3 Lightweight IOC container
<?php
require_once 'ioc.php';
class Material {
private $materialName = null;
public function __construct() {
}