Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* ファイルの情報を取得
*
* @param string $path ファイルパス
* @return object|bool ファイル情報
*/
public function getFileInfo($path)
{
if (!file_exists($path)) {
@ymxmore
ymxmore / android-tips.md
Last active October 2, 2018 02:14
Android開発においてのTips。

Android Tips

ADB 再起動

デバイス状態がOFFLINE時などに。

$ adb kill-server && adb start-server
@ymxmore
ymxmore / auto-commit-status.sql
Last active May 29, 2018 01:27
オートコミットの状態
-- 状態確認
SELECT @@global.autocommit, @@session.autocommit;
-- 変更
SET @@session.autocommit=OFF;
@ymxmore
ymxmore / innodb-status.sql
Created May 29, 2018 00:51
トランザクションなどの確認
set GLOBAL innodb_status_output=ON;
set GLOBAL innodb_status_output_locks=ON;
SHOW ENGINE INNODB STATUS;
ps alx | grep php | awk '{printf ("%d\t%s\n", $8,$13)}'

regexp

\* @(.+?) +(.+?) +(.+?) +(.+?)\n

replace

* @$1 $2 $3 $4\n

dir

./src/,./tests/,*.php

# npm global
npm install -g \
np \
npm-check-updates \
fixpack \
gulp \
yarn \
eslint \
eslint-config-google
@ymxmore
ymxmore / bash
Created August 19, 2016 02:17
php-cs-fixer
php-cs-fixer.phar fix [dir|file] --fixers=-psr0,-empty_return,-concat_without_spaces,-phpdoc_short_description,-phpdoc_indent,-single_array_no_trailing_comma,extra_empty_lines,concat_with_spaces,short_array_syntax
ps ax | grep <process name> | grep -v grep | awk '{print $1}' | sudo xargs kill -9
# Terminal
COLOR_BOLD="\[\e[1m\]"
COLOR_DEFAULT="\[\e[0m\]"
PS1="$COLOR_BOLD\u@\h \W \$ $COLOR_DEFAULT"
export CLICOLOR=1
# PATH
export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin