Skip to content

Instantly share code, notes, and snippets.

@kkkw
kkkw / cvimrc.vim
Last active December 11, 2019 10:43
cvimrc.vim
" # general
set autoupdategist " gistの設定を自動反映
let scrollstep = 150
let fullpagescrollpercent = 100
set smoothscroll
set noautofocus " サイトを開いた時に入力欄にフォーカスが奪われるのを抑止
let searchlimit = 20
let barposition = "bottom"
@kkkw
kkkw / gist:e18cd2441347a508f84ecabcd86d5fe9
Created August 25, 2017 08:23
PhpStorm noinspection
PhpStorm noinspection
MessDetectorValidationInspection
PhpAbstractStaticMethodInspection
PhpAssignmentInConditionInspection
PhpAssignmentReplaceableWithOperatorAssignmentInspection
PhpAssignmentReplaceableWithPrefixExpressionInspection
PhpCSValidationInspection
PhpClassNamingConventionInspection
PhpConstantNamingConventionInspection
@kkkw
kkkw / Client.php
Last active July 5, 2017 03:07
sample
<?php
namespace Foo\Queue\Contract;
interface Client
{
public static function get_instance();
public function message($mesage);
}
$bench_start = microtime(true);
$process_at_least = 0.05;
foreach (range(1,3000) as $i){
$process_start = microtime(true);
usleep(0.05 * 1000000);
$process_end = microtime(true);
$process_time = $process_end - $process_start;
echo 'proc:', $process_time,PHP_EOL;
if($process_at_least < $process_time){
@kkkw
kkkw / gist:dc2eb15f857ac9662b559b9acc1afa11
Created May 11, 2017 03:17
atomでhtml開くときsjisで開くinitスクリプト
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@kkkw
kkkw / foo.js
Created October 21, 2016 07:14
(function($){
$(function(){
var Page = {
myProp:[],
selector:'#foo',
init: function(){
@kkkw
kkkw / phpcs.md
Last active March 19, 2024 06:59
phpcsで警告が出たときに見直す内容とか
ルール 内容
Generic.WhiteSpace.DisallowTabIndent.TabsUsed インデントにハードタブを使っている。ソフトタブにすること
Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine メソッドの開始ブレスは、改行すること
CakePHP.Commenting.FunctionComment.Missing phpdocのコメントがない
CakePHP.WhiteSpace.TabAndSpace タブとスペースに関するエラー。インデント揃えのための複数スペースはダメなど。
Generic.WhiteSpace.DisallowTabIndent.NonIndentTabsUsed インデント揃えをするためにハードタブを使ってはならない。スペースを使うこと
Squiz.WhiteSpace.SuperfluousWhitespace.EndLine 行末などに不要なスペースがある。もしくは、スペースのみの行がある。
CakePHP.WhiteSpace.CommaSpacing 関数コールで引数を渡すとき、カンマの前にスペースがある場合など
CakePHP.NamingConventions.ValidFunctionName.PrivateMethodInCore これはなぞ。
@kkkw
kkkw / Vagrantfile
Created October 19, 2016 10:37
sample vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@kkkw
kkkw / ansible-coding-style.md
Last active September 6, 2017 02:53
ansibleのコーディング規約

ansibleのコーディング規約

一般

バージョン

  • [MUST] バージョン2以上でエラーが出ないように記述して下さい。

タブ/スペース

sync-settings