Skip to content

Instantly share code, notes, and snippets.

kurozumi kurozumi

Block or report user

Report or block kurozumi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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;
@kurozumi
kurozumi / wp-media.php
Created Oct 30, 2018
WP REST API v2で画像投稿
View wp-media.php
<?php
require_once( dirname( __FILE__ ) . '/wp-load.php' );
// APIエンドポイントのURL
$url = 'http://sample.com/wp-json/wp/v2/media';
// ユーザー名(Application Passwordsプラグインでパスワードを発行したユーザーのもの)
$username = 'test';
// パスワード(Application Passwordsプラグインで発行されたパスワード)
@kurozumi
kurozumi / api-post.php
Last active Oct 30, 2018
WP REST API v2で新規投稿
View api-post.php
<?php
require_once( dirname( __FILE__ ) . '/wp-load.php' );
// APIエンドポイントのURL
$url = 'http://sample.com/wp-json/wp/v2/posts';
// ユーザー名(Application Passwordsプラグインでパスワードを発行したユーザーのもの)
$username = 'test';
// パスワード(Application Passwordsプラグインで発行されたパスワード)
@kurozumi
kurozumi / datepicker.js
Created Oct 10, 2018
Datepickerの日付に数字を追加する
View datepicker.js
<html>
<head>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
var stocks = {"2018\/10\/11":13,"2018\/10\/12":10,"2018\/10\/13":10,"2018\/10\/14":10,"2018\/10\/15":10,"2018\/10\/16":11,"2018\/10\/17":11,"2018\/10\/18":11,"2018\/10\/19":12,"2018\/10\/20":12,"2018\/10\/21":12,"2018\/10\/22":12,"2018\/10\/23":15,"2018\/10\/24":16,"2018\/10\/25":15,"2018\/10\/26":15,"2018\/10\/27":15,"2018\/10\/28":17,"2018\/10\/29":17,"2018\/10\/30":17,"2018\/10\/31":17,"2018\/11\/1":17,"2018\/11\/2":17,"2018\/11\/3":17,"2018\/11\/4":17,"2018\/11\/5":17,"2018\/11\/6":18,"2018\/11\/7":18,"2018\/11\/8":19,"2018\/11\/9":19,"2018\/11\/10":19,"2018\/11\/11":19,"2018\/11\/12":19,"2018\/11\/13":19,"2018\/11\/14":20,"2018\/11\/15":"21","2018\/11\/16":"21","2018\/11\/17":"21","2018\/11\/18":"21","2018\/11\/19":"21","2018\/11
You can’t perform that action at this time.