Skip to content

Instantly share code, notes, and snippets.

View nojimage's full-sized avatar

Takashi Nojima nojimage

View GitHub Profile
@nojimage
nojimage / content.md
Last active May 25, 2022 01:30
MariaDBのダンプをMySQL Workbenchで取る方法
@nojimage
nojimage / xdebug-3-upgrade-guide.ja.md
Last active July 9, 2024 19:40
Xdebug 3 アップグレードガイド

Xdebug 3 アップグレードガイド

原文: https://xdebug.org/docs/upgrade_guide

Xdebug 2 から 3 へのアップグレード

An upgrade guide detailing which changes there are between Xdebug 2 and 3, and how to reconfigure your set-up to do similar things.

このアップグレードガイドは、Xdebug 2から3への変更点と、同様のことを行うようにセットアップを再構成する方法を詳しく説明します。

@nojimage
nojimage / init-vmware-catalina.sh
Last active March 17, 2020 05:00
Fixes VMWare black screen when macOS update to Catalina
#!/bin/sh
#
# Running on macOS Recovery Mode Terminal
#
# 1. Save this script to Your home dir.
# eg) /Users/your-name/init-vmware-catalina.sh
#
# 2. Restart the machine and go to Recovery Mode.
# (hold [⌘ + R] when the computer starts until you see an Apple logo)
@nojimage
nojimage / build.sh
Last active January 24, 2020 04:02
install php 5.6.40 with brew
## install openssl 1.0.2t
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
git checkout 8b9d6d688f483a0f33fcfc93d433de501b9c3513 -- openssl.rb
brew install openssl
## build php: "/usr/local/Cellar/icu4c/64.2" is a specific icu4c version.
LDFLAGS=-L/usr/local/Cellar/icu4c/64.2 \
CONFIGURE_OPTS="--with-pear --with-openssl=/usr/local/Cellar/openssl/1.0.2t --with-icu-dir=/usr/local/Cellar/icu4c/64.2" \
phpenv install 5.6.40
@nojimage
nojimage / rector.sh
Created January 10, 2020 08:44
rector on docker の起動コマンドサンプル
docker run --rm -v "$(pwd)":/app -w /app --entrypoint /rector/bin/rector rector/rector process src --dry-run
@nojimage
nojimage / genuuid4.php
Last active November 26, 2019 10:58 — forked from tanakahisateru/genuuid4.php
NEVER USE this UUIDv4 generator
#!/usr/bin/env php
<?php
/**
* composer init && composer require cakephp/utility:^3.8
*
* Try < PHP 5.6: ./genuuid4.php 65536 | sort | uniq -d
*/
require 'vendor/autoload.php';
use Cake\Utility\Text;
@nojimage
nojimage / bootstrap_cli.php
Last active October 30, 2019 03:15
Bake Entity with column comment
<?php
// in bootstrap_cli.php
if (PHP_SAPI === 'cli' && Configure::read('debug')) {
// Bake書き換え
EventManager::instance()->on('Bake.beforeRender', static function (Event $event) {
$view = $event->getSubject();
/* @var $view View */
// for Bake Entity
if ($view->get('propertySchema') && $view->get('table') && $view->get('name')) {
// propertySchemaを書き換えてスキーマコメントを付与する
function hash_get(key, haystack) {
const keys = key.split('.');
if (!Object.prototype.hasOwnProperty.call(haystack, keys[0])) {
return null;
}
const matched = haystack[keys[0]];
if (keys.length === 1) {
return matched;
}
@nojimage
nojimage / ChunkInsertTestFixture.php
Last active May 17, 2019 03:54
CakePHP 3 TextFixture for many records
<?php
namespace App\TestSuite\Fixture;
use Cake\Datasource\ConnectionInterface;
use Cake\TestSuite\Fixture\TestFixture;
/**
* ChunkInsertTestFixture
*/
abstract class ChunkInsertTestFixture extends TestFixture
<?php
/**
* Copyright 2018 Takashi Nojima.
*/
namespace App\Routing;
use Cake\Controller\Controller;
use Cake\Http\ControllerFactory;
use Cake\Http\Response;