Skip to content

Instantly share code, notes, and snippets.

View Kuniwak's full-sized avatar
💭
I may be slow to respond.

Yuki Kokubun Kuniwak

💭
I may be slow to respond.
View GitHub Profile
@Kuniwak
Kuniwak / major-linters.md
Last active August 29, 2015 14:02
Major linter の戦略と実装

Major linter の戦略と実装

Perl::Critic

  • 構文解析器: PPI
  • ポリシーはオブジェクト: Perl::Critic::Policy
  • 違反もオブジェクト: Perl::Critic::Violation
  • 処理の流れ
    1. 有効な検査ポリシーが設定される
    2. 検査ポリシーごとに以下を繰り返す(Perl::Critic#_gather_violations $doc : @violations
  1. 検査ポリシーが解析に必要な要素名を宣言する(Perl::Critic::Policy#applies_to : String[]
@Kuniwak
Kuniwak / perl-critic-error-type.md
Last active August 29, 2015 14:02
Perl::Criticの警告一覧

Perl::Criticのエラー

これの車輪の再発明っぽい: PolicySummary.pod

Perl::Critic の警告 内容
ProhibitBooleanGrep Use List::MoreUtils::any instead of grep in boolean context.
ProhibitComplexMappings Map blocks should have a single statement.
ProhibitLvalueSubstr Use 4-argument substr instead of writing substr($foo, 2, 6) = $bar.
@Kuniwak
Kuniwak / tmux_cheetsheet.markdown
Last active August 29, 2015 14:03
tmux 覚えられなかったので画面の横に貼る。

tmux cheetsheet

Command

command name command
start new tmux
start new with session name tmux new -s name

Quiz1

#!/usr/bin/env perl
use strict;
use warnings;

print 1;

BEGIN {
@Kuniwak
Kuniwak / file0.txt
Created August 12, 2014 23:24
peco と alias -g で git に便利革命おきた ref: http://qiita.com/Kuniwak/items/b711d6c3e402dfd9356b
$ git commit
stmt left list op rest right type
let num = 0 identifier = number let
let dict[key] = 0 dot = number let
let list[0] = 99 subscript = number let
let list[1:2] = [99, 99] slice = list let
let str .= 'str_to_add' identifier .= number let
let $ENV = 'str_content' env = string let
let @@ = 'str_content' reg = string let
let [elem0, elem1] = [0, 1] [identifier, identifier] = list let
  1. identifier が定義・参照・静的解析不能を判別
    • IdentifierClassifier
    • IdentifierCollector
  2. Scope chain を作成
    • ScopeStore
  3. declaring identifier を scope に登録、scope を referencing identifier に登録
    • ScopeLinker
  4. referencing identifier から declaring identifier に到達可能かどうかを調べる
    • ParentAttacher
    • ReferenceReachabilityTester
@Kuniwak
Kuniwak / file0.txt
Last active August 29, 2015 14:11
vimrc アンチパターンを自動でチェックする ref: http://qiita.com/Kuniwak/items/407ab494281427847af0
pip install vim-vint
@Kuniwak
Kuniwak / .cvimrc
Last active August 29, 2015 14:17
map <C-u> scrollPageUp
map <C-d> scrollPageDown
map <C-h> deleteChar
cunmap <C-h>
let scrollstep = 200
@Kuniwak
Kuniwak / 4bit_adder.ts
Created July 13, 2015 12:14
Compile-Time 4-bit adder on TypeScript
// Compile-Time 4-bit Adder for TypeScript
// Author: https://github.com/Kuniwak
// INTPUT ////////////////////////////////
// O: Low
// I: High
let inputA1: I;
let inputA2: I;
let inputA3: O;