Skip to content

Instantly share code, notes, and snippets.

View nanasess's full-sized avatar
🍣
Sushi chef

Kentaro Ohkouchi nanasess

🍣
Sushi chef
View GitHub Profile
@nanasess
nanasess / Jwks.cs
Created August 8, 2017 01:04
RSA public key to JWKs(JSON Web Key Set) for C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
namespace TestCommands
@nanasess
nanasess / recaptcha.php
Created September 12, 2017 09:16
Example for reCAPTCHA V2
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script>
function onSubmit(token) {
document.getElementById("test").submit();
@nanasess
nanasess / symfony-profiler-on-production.patch
Last active April 19, 2021 14:58
Symfony Profiler on APP_ENV=prod
From 796868cf2bfece8e0912fe3c30a37e76d505da5c Mon Sep 17 00:00:00 2001
From: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
Date: Thu, 16 Aug 2018 09:35:23 +0900
Subject: [PATCH] =?UTF-8?q?WebProfiler=20=E3=82=92=20production=20?=
=?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=89=E3=81=A7=E5=8B=95=E4=BD=9C=E3=81=95?=
=?UTF-8?q?=E3=81=9B=E3=82=8B=E8=A8=AD=E5=AE=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@nanasess
nanasess / gtags.conf
Created November 29, 2011 10:34
configration for gtags
#
# Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003, 2010, 2011
# Tama Communications Corporation
#
# This file is part of GNU GLOBAL.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
@nanasess
nanasess / eccube3.md
Last active November 25, 2019 08:11
EC-CUBE3の実装上の課題メモ

EC-CUBE3の実装上の課題

全体

  • 主に、ユーザーがカスタマイズするコードは app/Eccube 以下に置きたい
  • src/Eccube 以下のコードは、極力触らないようにしたい
    • 修正したい場合は app/Eccube 以下でオーバーライド
    • 必要なコントローラのみオーバーライドすれば良いので、2系の extends よりわかりやすいはず
    • プラグインがコントローラを継承しないように、構造で何とかしたい
@nanasess
nanasess / config.php
Created November 21, 2019 12:56
ec-cube2 configuration of Azure WebApps on localdb
<?php
preg_match('/Database=(.*);Data Source=(.*):(.*);User Id=(.*);Password=(.*)$/', $_SERVER['MYSQLCONNSTR_localdb'], $matches);
list($ds, $dbname, $dbhost, $dbport, $dbuser, $dbpass) = $matches;
define('ECCUBE_INSTALL', 'ON');
define('HTTP_URL', 'https://example.azurewebsites.net/');
define('HTTPS_URL', 'https://example.azurewebsites.net/');
define('ROOT_URLPATH', '/');
define('DOMAIN_NAME', '');
define('DB_TYPE', 'mysql');
define('DB_USER', $dbuser);
@nanasess
nanasess / generator.php
Created August 5, 2019 10:57
データ生成スクリプト for EC-CUBE2.17
<?php
require __DIR__.'/require.php';
ini_set('display_errors', 1);
// Here you can initialize variables that will be available to your tests
$config = [
'fixture_customer_num' => 10, // 会員数
'fixture_product_num' => 30000, // 商品数
'fixture_order_num' => 1 // 注文数
];
@nanasess
nanasess / eccube-2.13.5-2.17.patch
Created August 3, 2019 02:54
EC-CUBE2.13.5 と 2.17-RC の差分
diff -urb 2_13/.coveralls.yml 2_17/.coveralls.yml
--- 2_13/.coveralls.yml 2019-08-03 11:41:43.000000000 +0900
+++ 2_17/.coveralls.yml 2019-08-03 09:51:39.000000000 +0900
@@ -1,5 +1,4 @@
# for php-coveralls
# see also. https://coveralls.io
-src_dir: data
coverage_clover: reports/coverage/coverage.xml
json_path: reports/coverage/coveralls-upload.json
diff -urb 2_13/.gitignore 2_17/.gitignore
@nanasess
nanasess / createEcCubeData-v40.php
Last active February 21, 2019 07:20
データ生成スクリプト for EC-CUBE4
#!/usr/local/bin/php -q
<?php
use Doctrine\ORM\EntityManagerInterface;
use Eccube\Kernel;
use Dotenv\Dotenv;
/*
* EC-CUBE データ生成スクリプト
*
* Copyright(c) 2000-2014 LOCKON CO.,LTD. All Rights Reserved.
@nanasess
nanasess / wordpress-relate-eccube.patch
Created December 8, 2018 08:17
EC-CUBEの定数を変更する
diff --git a/data/class/SC_Initial.php b/data/class/SC_Initial.php
index aa25b299b2..f57c908dc9 100644
--- a/data/class/SC_Initial.php
+++ b/data/class/SC_Initial.php
@@ -83,10 +83,10 @@ class SC_Initial
*/
public function defineDSN()
{
- if (defined('DB_TYPE') && defined('DB_USER') && defined('DB_PASSWORD')
- && defined('DB_SERVER') && defined('DB_PORT') && defined('DB_NAME')