Skip to content

Instantly share code, notes, and snippets.

View miya0001's full-sized avatar

Takayuki Miyauchi miya0001

View GitHub Profile

目的

持続性がある方法を目指す。

  • インフラコストがかからないこと。
  • 特定の誰かに権限が集中しないこと。
  • すべてが公開された場所に残ること。(たとえば閲覧する際に認証とが必要ないこと。パーマリンクがあって後から参照しやすいこと。)
  • オープンソースコミュニティっぽい方法であること。「オープンソースっぽい」は毎日進化してます。
@miya0001
miya0001 / file0.txt
Last active April 5, 2018 08:06
PHPUnitでHTMLをDOMでパースしてテスト ref: https://qiita.com/miya0001/items/178f31035f63bba63f67
$ composer require symfony/dom-crawler symfony/css-selector --dev
@miya0001
miya0001 / install-php56-to-vccw.sh
Last active March 21, 2018 12:51
Install PHP 5.6 into the VCCW
#!/usr/bin/env bash
set -ex
PHP_VERSION=${1-"7.0"}
sudo apt update -y
sudo apt install \
php${PHP_VERSION} \
@miya0001
miya0001 / jpegoptim.php
Created March 20, 2018 19:33
Optimizing images for WordPress with the jpegoptim
<?php
add_filter( 'wp_image_editors', function( $editors ) {
if ( ! class_exists( '_WP_Image_Editor_GD' ) ) {
class _WP_Image_Editor_GD extends WP_Image_Editor_GD {
protected function _save( $image, $filename = null, $mime_type = null ) {
$saved = parent::_save( $image, $filename, $mime_type );
if ( ! empty( $saved["mime-type"] ) && 'image/jpeg' == $saved["mime-type"] ) {
jpegoptim( $saved['path'] );
}
diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php
index aaf39713..ae0adb9d 100644
--- a/features/bootstrap/FeatureContext.php
+++ b/features/bootstrap/FeatureContext.php
@@ -1,14 +1,14 @@
<?php
use Behat\Behat\Context\ClosuredContextInterface,
- Behat\Behat\Context\TranslatedContextInterface,
- Behat\Behat\Context\BehatContext,
@miya0001
miya0001 / mysql.sh
Created September 14, 2017 06:20
MySQL on Dokcer
sudo chown -R mysql:mysql /var/lib/mysql
sudo mysql_install_db --datadir=/var/lib/mysql --user=mysql
sudo service mysql start
@miya0001
miya0001 / post.feature
Created August 12, 2017 09:23
WordPressにBehatで投稿
Feature: Example Features
Scenario: Publish a post
Given the screen size is 1440x900
And I login as the "administrator" role
And I am on "/wp-admin/post-new.php"
When I press "テキスト"
And I fill in the following:
@miya0001
miya0001 / lightning.feature
Last active August 11, 2017 20:01
Behat testing for Lightning theme
Feature: Features of the Lightning theme
Scenario: Tests for the menu with PC
Given the screen size is 1440x900
When I am on "/"
Then I should see "Home" in the "#gMenu_outer" element
And I should see "Forum" in the "#gMenu_outer" element
@miya0001
miya0001 / runwp.sh
Created June 23, 2017 04:05
WP-CLI で WordPress のローカル環境を作るサンプル
#!/usr/bin/env bash
set -ex
echo "CREATE DATABASE IF NOT EXISTS wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" | mysql -uroot
wp core download --path=$(pwd) --locale=ja
wp config create \
--dbhost=localhost \
@miya0001
miya0001 / mapping-in-kushimoto.md
Last active May 14, 2017 00:17
マッピングパーティ in 串本

マッピングパーティ in 串本

マッピングパーティとは

地元の人で集まって地域の地図を充実させる活動です。

地域の地図をみなさんの手で充実させていくことで、観光振興や災害時に役立てることができます。また、地域をより深く知るきっかけにもなります。

さらに、未来の IT 社会を担うための重要な社会基盤を、幅広い年齢層が協力しあって作ることができます。