Skip to content

Instantly share code, notes, and snippets.

@skydiver
skydiver / app.scss
Created May 23, 2020 19:33
Laravel + Tailwind CSS + Hot Reload
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@Vinai
Vinai / magento-composer-issues.md
Last active April 15, 2020 03:09
My beef with composer and Magento
@piotrekkaminski
piotrekkaminski / MPERF-10565.diff
Created April 8, 2019 18:04
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@apiworks
apiworks / mamp.nginx.magento1.conf.sample
Created November 6, 2017 09:20
Magento 1 NGINX config for MAMP Pro
server {
listen 80;
server_name sample.loc;
set $MAGE_ROOT /Users/darkogoles/Sites/sample.loc;
access_log /usr/local/etc/nginx/logs/sample_access.log;
error_log /usr/local/etc/nginx/logs/sample_error.log;
root $MAGE_ROOT;
@apiworks
apiworks / mamp.nginx.magento.conf.sample
Last active September 19, 2022 14:01
Magento 2 NGINX config for MAMP Pro
server {
listen 80;
server_name site.loc;
set $MAGE_ROOT /Users/darkogoles/Sites/site.loc/http;
set $LARAVEL_ROOT /Users/darkogoles/Sites/site.loc/shipping/http;
root $MAGE_ROOT/pub;
index index.php;
@ecomcoders
ecomcoders / M2 config.xml
Last active August 17, 2017 14:38
Magento 2 PHPStorm File Templates
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
</default>
</config>
@ecomcoders
ecomcoders / EcomCoders.xml
Created August 7, 2017 11:41
PHPStorm Live-Templates for Magento 2 setter/getter methods
<templateSet group="EcomCoders">
<template name="m2setget" value="/**&#10;* Getter for $FIELD_UNDERSCORES$&#10;* &#10;* @return $TYPEHINT$|null&#10;*/&#10;public function get$FIELD_CAMELCASE_CAPITALIZED$()&#10;{&#10; return $this-&gt;_getData('$FIELD_UNDERSCORES$');&#10;}&#10;&#10;/**&#10;* Setter for $FIELD_UNDERSCORES$&#10;*&#10;* @param $TYPEHINT$ $$$FIELD_CAMELCASE$&#10;* @return $this&#10;*/&#10;public function set$FIELD_CAMELCASE_CAPITALIZED$($$$FIELD_CAMELCASE$)&#10;{&#10; return $this-&gt;setData('$FIELD_UNDERSCORES$', $$$FIELD_CAMELCASE$);&#10;}$END$" description="Magento2-Setter/Getter-Method" toReformat="true" toShortenFQNames="true">
<variable name="FIELD_UNDERSCORES" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="FIELD_CAMELCASE" expression="camelCase(FIELD_UNDERSCORES)" defaultValue="" alwaysStopAt="false" />
<variable name="FIELD_CAMELCASE_CAPITALIZED" expression="capitalize(camelCase(FIELD_UNDERSCORES))" defaultValue="" alwaysStopAt="false" />
<var
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active June 21, 2024 09:05
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@andkirby
andkirby / slack.sh
Last active June 5, 2024 09:55
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@aadmathijssen
aadmathijssen / add-checkout-form-key.sh
Last active October 29, 2019 13:52 — forked from schmengler/add-checkout-form-key.sh
Magento SUPEE-9767 Checkout Form Key Theme Patch
find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or -name 'shipping_method.phtml' -or -name 'payment.phtml' -or -name 'addresses.phtml' \
| xargs grep -L formkey \
| xargs perl -i -pe 's/<\/form>/<?php echo \$this->getBlockHtml("formkey") ?>\n<\/form>/g'
find -L skin/frontend -name 'opcheckout.js' \
| xargs grep -L form_key \
| xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) \{/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
find -L js -name 'payment.js' \
| xargs grep -L form_key \