Skip to content

Instantly share code, notes, and snippets.

View ponko2's full-sized avatar

Takahito Nakano ponko2

  • Shizuoka, Japan
  • 15:04 (UTC +09:00)
View GitHub Profile
@ponko2
ponko2 / codeStyleSettings.xml
Created September 18, 2014 07:49
PhpStormのCode Style設定
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="ALIGN_ASSIGNMENTS" value="true" />
@ponko2
ponko2 / ConfigServiceProvider.php
Created January 29, 2015 01:52
localのときだけServiceProviderを追加
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ConfigServiceProvider extends ServiceProvider
{
/**
* Overwrite any vendor / package configuration.
*
* This service provider is intended to provide a convenient location for you
@ponko2
ponko2 / default.rb
Created April 10, 2015 07:51
itamaeでimmediatelyなnotifiesが連鎖したときの実行結果
execute 'task1' do
command 'echo "task1"'
notifies :run, 'execute[task2]', :immediately
end
execute 'task2' do
command 'echo "task2"'
notifies :run, 'execute[task3]', :immediately
action :nothing
end
@ponko2
ponko2 / default.rb
Created April 10, 2015 11:46
itamaeでdelayedなnotifiesが連鎖したときの実行結果
execute 'task1' do
command 'echo "task1"'
notifies :run, 'execute[task2]', :delayed
end
execute 'task2' do
command 'echo "task2"'
notifies :run, 'execute[task3]', :delayed
action :nothing
end
@ponko2
ponko2 / gist:da4f10e956f3c6de6ac2
Created May 11, 2015 03:26
Atom linter-eslint plugin v0.5.4 + ESLint v0.21.0 でESLint Pluginが読み込まれない問題への応急処置
--- lib/linter-eslint.coffee
+++ lib/linter-eslint.coffee
@@ -71,6 +71,9 @@ class LinterESLint extends Linter
if @localEslint
options.plugins = config.plugins
engine = new CLIEngine(options)
+ config.plugins.forEach (key) ->
+ plugin = require(resolve("eslint-plugin-#{key}", {basedir: path.dirname(origPath)}))
+ engine.addPlugin(key, plugin)
else
@ponko2
ponko2 / anyframe-widget-interactive-git-rebase
Created June 6, 2015 15:31
anyframe で git rebase -i
git log --oneline --decorate --no-color \
| anyframe-selector-auto \
| awk '{print $1 "^"}' \
| anyframe-action-execute git rebase -i
@ponko2
ponko2 / AsyncTask1.java
Created August 27, 2011 16:21
ScalaでAndroidアプリ作成時、AsyncTaskの可変長引数メソッドが使えないことへの対策とサンプル
package jp.ponko2.android.os;
import android.os.AsyncTask;
public abstract class AsyncTask1<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
@Override
protected Result doInBackground(Params... params) {
return doInBackground(params.length > 0 ? params[0] : null);
}
@ponko2
ponko2 / test.scala
Created September 17, 2011 21:32
テスト駆動開発入門のxUnitをScalaで書いてみた
package jp.ponko2.tddbook.xunit
object Main extends App {
val suite = new TestSuite()
suite.add(new TestCaseTest("testTemplateMethod"))
suite.add(new TestCaseTest("testResult"))
suite.add(new TestCaseTest("testFailedResult"))
suite.add(new TestCaseTest("testFailedResultFormatting"))
suite.add(new TestCaseTest("testSuite"))
val result = new TestResult()
@ponko2
ponko2 / .zshrc
Created January 2, 2012 17:36
画像の0埋め連番リネームとサイズ調整 ref: http://qiita.com/items/1534
# zmvを使えるようにする
autoload -Uz zmv
@ponko2
ponko2 / .zshrc
Created January 2, 2012 20:19
Gitのルートディレクトリへ簡単に移動できるようにする関数 ref: http://qiita.com/items/1535
function git-root() {
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
cd `git rev-parse --show-toplevel`
fi
}