Skip to content

Instantly share code, notes, and snippets.

@shyim
shyim / Dockerfile
Created February 7, 2021 19:30
Run PhpStorm with own Docker inside Docker
FROM registry.jetbrains.team/p/prj/containers/projector-phpstorm
USER root
ENV DOCKER_HOST=tcp://docker:2375
ENV PS1 '${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
ENV DOCKERVERSION=20.10.3
RUN apt-get update && \
apt-get install -y curl git vim && \
@shyim
shyim / createMedia.php
Created February 26, 2020 13:01
Create media in shopware 6
$mediaId = Uuid::randomHex();
$mediaRepository->create([['id' => $mediaId]], Context::createDefaultContext());
$request = new Request();
$request->headers->set('content_type', 'application/json');
$request->query->set('extension', 'png');
$request->request->set('url', 'https://placekitten.com/200/287');
$mediaFile = $mediaService->fetchFile($request);
$fileSaver->persistFileToMedia(
@shyim
shyim / README.md
Created January 4, 2020 11:52
Develop in Docker Container
docker run \
    --privileged \
    -d \
    --name vm-docker \
    docker:18.09.7-dind

docker run \
    --name vm \
 -d \
@shyim
shyim / README.md
Last active November 19, 2019 15:53
Shopware 5.7 Update Prepare Guide

List of compability issues with Shopware 5.7

Updates

  • Symfony 3.4 => Symfony 4.4
  • Guzzle 5 => Guzzle 6.4 (Consider using PSR18 Http Client)
  • Monolog 1 => Monolog 2

Breaking things

@shyim
shyim / Emotion.php
Created March 21, 2018 08:24
DatabaseEntitiesBuilder generated example
<?php
namespace ShyimDatabaseEntitiesGenerator\Models\Emotion;
use ShyimDatabaseEntitiesGenerator\Models\AbstractEntity;
/**
* Entity for table s_emotion
*/
class Emotion extends AbstractEntity
@shyim
shyim / shipping.sql
Created January 18, 2018 13:40
Shopware eigene Versandkosten Bedingung Ausschluss Deutscher Insel
us.zipcode NOT IN (18565,25845,25846,25847, 25849, 25859, 25863, 25869, 25929,25930,25931,25932,25933, 25938,25939,25940,25941,25942, 25946,25947, 25948, 25949,
25952,25953,25954,25955, 25961-25970, 25980, 25985,25986, 25988,25989,25990, 25992,25993,25994, 25996,25997, 25998, 25999, 26465, 26474, 26486, 26548,
26571, 26579, 26757, 27498, 83256)
@shyim
shyim / gist:5785988ed5b2ba8979a15f045ad25534
Created January 3, 2018 08:49
self signed ssl cert using custom ca
openssl genrsa -out ca.key 2048
openssl req -new -x509 -sha256 -days 20000 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt
openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=*.somersets.de" -out server.csr
openssl x509 -req -sha256 -extfile <(printf "subjectAltName=DNS:dev.somersets.de") -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
@shyim
shyim / README.md
Last active April 24, 2017 10:33
Shopware Plugin Supports
@shyim
shyim / keybase.md
Created February 15, 2017 13:41
keybase.md

Keybase proof

I hereby claim:

  • I am shyim on github.
  • I am shyim (https://keybase.io/shyim) on keybase.
  • I have a public key whose fingerprint is 6996 4055 BFFD 0548 F25F A9F9 9BA8 CD75 FEAA C81D

To claim this, I am signing this object:

@shyim
shyim / ShyimCron.php
Created October 4, 2016 12:09
Simple Cron in Shopware 5.2 Pluginsystem
<?php
namespace ShyimCron;
use Shopware\Components\Plugin;
use Shopware\Components\Plugin\Context\InstallContext;
use Shopware\Components\Plugin\Context\UninstallContext;
class ShyimCron extends Plugin {
public static function getSubscribedEvents()