Skip to content

Instantly share code, notes, and snippets.

kurozumi kurozumi

View GitHub Profile
@kurozumi
kurozumi / ProductSubscriber.php
Last active Apr 21, 2020
イベントで商品IDをクッキーの保存・取得を行う
View ProductSubscriber.php
<?php
namespace Customize\EventSubscriber;
use Customize\Service\CheckedProduct;
use Eccube\Common\EccubeConfig;
use Eccube\Event\TemplateEvent;
use Eccube\Repository\ProductRepository;
@kurozumi
kurozumi / CheckedProduct.php
Last active Apr 21, 2020
商品IDをCookieに保存したり取得したり
View CheckedProduct.php
<?php
namespace Customize\Service;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Eccube\Entity\Product;
use Symfony\Component\HttpFoundation\Cookie;
@kurozumi
kurozumi / main.yml
Last active Feb 10, 2020
CI/CD for EC-CUBE4 PLUGIN
View main.yml
name: CI/CD for EC-CUBE4 PLUGIN
on: push
env:
PLUGIN_CODE: EmailEntry4
ECCUBE_BRANCH: '4.0'
jobs:
mysql:
name: MySQL
runs-on: ubuntu-latest
strategy:
View gist:9717a5dddf46650aeb9de5fafd3457a2
<?php
/*
* Copyright (C) 2019 Akira Kurozumi <info@a-zumi.net>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
View image_add.js
{% block javascripts %}
<script src="//blueimp.github.io/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
<script src="//blueimp.github.io/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
<script src="//blueimp.github.io/jQuery-File-Upload/js/jquery.fileupload.js"></script>
<script src="//blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<script src="//blueimp.github.io/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
<script src="//blueimp.github.io/jQuery-File-Upload/js/jquery.fileupload-image.js"></script>
<script type="text/javascript">
$('#{{ form.image.vars.id}}').fileupload({
url: "{{ url("image_add") }}",
View gist:6ba276b05b0ea2653d5692b251b5e723
<?php
namespace App\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
View ImageController.php
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
@kurozumi
kurozumi / FileUploader.php
Created Feb 25, 2019
FileUploader Service
View FileUploader.php
<?php
namespace App\Service;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Description of FileUploader
*
@kurozumi
kurozumi / thumbnails.php
Last active Dec 27, 2018
【WordPress】画像サイズを登録する
View thumbnails.php
<?php
/*
* アイキャッチ画像を有効化
*/
add_theme_support('post-thumbnails');
/*
* 画像サイズ登録
* [width, height, [true|false|array]]
@kurozumi
kurozumi / LineAuthenticator.php
Created Dec 17, 2018
SymfonyでLineログイン
View LineAuthenticator.php
<?php
namespace App\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
You can’t perform that action at this time.