Skip to content

Instantly share code, notes, and snippets.

View rodde177's full-sized avatar

rodde177

  • sthlm
View GitHub Profile
@schmengler
schmengler / README.md
Last active April 17, 2019 08:56
Domain Objects from Magento Configuration

Domain Objects from Magento Configuration

A pattern suggestion to integrate framework independent domain models into Magento.

Problem:

We want to instantiate a domain model based on Magento configuration.

Implementation:

@ananth-iyer
ananth-iyer / CsrfValidatorSkip.php
Last active October 30, 2023 10:33
Magento 2.3.0: Implement below code to skip the CSRF check on your custom route called outside Magento environment. This implementation does not break core frontend/adminhtml routes, Magento 2.3/2.2/2.1 web stores.
<?php
namespace Vendor\Module\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\ActionInterface $action
@alexellis
alexellis / README.md
Last active May 19, 2022 02:17
OpenFaaS Redis example

Redis & OpenFaaS micro-tutorial

After you've completed this micro-tutorial you'll be making requests to your Redis cache from serverless functions with OpenFaaS. From there it's up to you to build something awesome.

Pre-reqs:

Deploy OpenFaaS and the faas-cli.

This guide is for OpenFaaS on Kubernetes, but if you're using Swarm that's OK - you'll just have to adapt some of the commands for setting up Redis. The OpenFaaS code will be the same.

@TravisBernard
TravisBernard / allthethings.sh
Last active August 18, 2018 21:12
Clean all the things (M2)
#!/bin/bash
# Derived from
# https://github.com/btford/allthethings
#
# Licensed under WTFPL http://sam.zoy.org/wtfpl/
#
pur=$(tput setaf 5) # Purple
@vaibhavkumar-sf
vaibhavkumar-sf / docker-compose.yml
Created January 29, 2018 11:39
docker-compose.yml STATIC IP assignment to all containers of a docker
version: "2"
services:
varnish:
#hostname: magento2.docker
image: meanbee/magento2-varnish:latest
environment:
- VIRTUAL_HOST=magento2.docker
- VIRTUAL_PORT=80
- HTTPS_METHOD=noredirect
ports:
<?php
namespace Demo\Navigation\Plugin\Layer;
use Magento\Catalog\Model\ResourceModel\Layer\Filter\Attribute;
use Magento\Framework\App\RequestInterface;
use Magento\Catalog\Model\Layer\Filter\ItemFactory;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\Layer\FilterList;
use Magento\Catalog\Model\Product;
@tombigel
tombigel / README.md
Last active May 2, 2024 02:47 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@mnadel
mnadel / kcdo
Last active February 14, 2023 07:36
Exec Across (Some, All) Pods in Kubernetes
#!/usr/bin/env bash
PROGNAME=$(basename $0)
function usage {
echo "usage: $PROGNAME [-n NAMESPACE] [-m MAX-PODS] -s SERVICE -- COMMAND"
echo " -s SERVICE K8s service, i.e. a pod selector (required)"
echo " COMMAND Command to execute on the pods"
echo " -n NAMESPACE K8s namespace (optional)"
echo " -m MAX-PODS Max number of pods to run on (optional; default=all)"
@BretFisher
BretFisher / present.zsh-theme
Last active September 22, 2023 11:33
oh-my-zsh theme for presentations (hides prompt features based on path)
# problem: when presenting, I want to obscure
# my prompt to act like it's at root of file system
# and be very basic with no git info, etc.
# solution: this theme lets you set a ENV to the path
# of your presentation, which will help remove unneeded prompt
# features while in that path
# oh-my-zsh theme for presenting demos
# based off the default rubbyrussell theme