Skip to content

Instantly share code, notes, and snippets.

View ko2ic's full-sized avatar

koji ishii ko2ic

  • newspicks
  • Japan
View GitHub Profile
@ko2ic
ko2ic / checkstyle-config.xml
Last active August 29, 2015 14:00
mavenですべての設定ファイルを自動生成させる方法 ref: http://qiita.com/ko2ic/items/39be03afbc6c38c409ea
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-configurations file-format-version="5.0.0" default-check-configuration="Sun Checks">
<check-configuration name="sa-checkstyle" location="https://raw.githubusercontent.com/ko2ic/java-config/master/sa-checkstyle-5.6-utf8.xml" type="remote" description="">
<additional-data name="cache-file" value="false"/>
</check-configuration>
</checkstyle-configurations>
@ko2ic
ko2ic / _config.yml
Created April 21, 2014 12:01
OctopressのサイドバーにQiitaに投稿した人気記事を表示させる方法 ref: http://qiita.com/ko2ic/items/fafb61a67de0080c1178
qiita_user: user_name
qiita_display_count: 5
default_asides:[custom/asides/qiita.html]
@ko2ic
ko2ic / EclipseJavaMerger.java
Created April 23, 2014 13:22
自動生成したJavaコードに手を加えても綺麗にマージしてくれるJmerge ref: http://qiita.com/ko2ic/items/eb8107bd74ab510e0a6d
public class EclipseJavaMerger {
private final JMerger merger = new JMerger(buildMergeRule());
public String merge(String source, String target) {
try {
if (target == null) {
return source;
}
merger.setSourceCompilationUnit(merger.createCompilationUnitForContents(source));
@ko2ic
ko2ic / 00-chocolatey-install.bat
Last active February 5, 2020 20:17
00-chocolatey-install.batだけでOK。古い今は大丈夫→ windowsの環境構築をバッチファイルでやる。chocolatey-install.batで別プロセスでcinst を呼んでも駄目だった。https://github.com/chocolatey/chocolatey/issues/371
powershell Set-ExecutionPolicy RemoteSigned
powershell iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
powershell Set-ExecutionPolicy Restricted
set PATH=%PATH%;C:\Chocolatey\bin;
call cinst .\packages.config
pause
@ko2ic
ko2ic / 子pom.xml
Created May 25, 2014 09:31
mavenですべての設定ファイルを自動生成させる方法 - http://qiita.com/ko2ic/items/39be03afbc6c38c409ea
<properties>
<root.basedir>${project.parent.basedir}</root.basedir>
</properties>
<profiles>
<profile>
<id>conf</id>
<build>
<plugins>
@ko2ic
ko2ic / postProcessor.groovy
Last active August 29, 2015 14:05
jmeterのgroovyでのpost processorのサンプル
def response = prev.getResponseDataAsString()
def isLoggedin = false
if(response.contains("ログインしています")){
isLoggedin = true
}
vars.put('script.isLoggedin', isLoggedin.toString())
@ko2ic
ko2ic / chatwork.groovy
Created September 15, 2014 16:49
Jmeterの結果をChatworkで知らせる方法 ref: http://qiita.com/ko2ic/items/0c22be5ecf31820af2ef
def assertResults = prev.assertionResults;
def response = prev.responseDataAsString
def statusCode = prev.responseCode
def postBody
if(response.contains('ERROR') || assertResults.any{it.isFailure()} || statusCode != '200') {
postBody = ['body':'Error !']
}else {
postBody = ['body':'Success !']
@ko2ic
ko2ic / .bash_profile
Last active August 29, 2015 14:06
Railsローカルインストールからプロジェクト作成の半自動化 ref: http://qiita.com/ko2ic/items/f2ad0f326552794b8b67
function gi() { curl https://www.gitignore.io/api/$@ ;}
function rails_new(){
while read -p "Please enter project name: " railsName ; do
if [ -n "$railsName" ] ; then
break
fi
done
@ko2ic
ko2ic / git_clone_all_branch.sh
Last active August 29, 2015 14:26
すべてのブランチをcloneするスクリプト
for i in `git branch -r | grep -v HEAD | grep -v master | sed 's:origin/::g'`
do
git checkout --track -b $i origin/$i
done
git checkout master
@ko2ic
ko2ic / deleteDependencyLibrary.sh
Last active December 22, 2015 03:06
static ライブラリから不必要な依存ライブラリを削除
#!/bin/sh
archtectureStr=`lipo -info $1 | awk '$0 = substr($0, index($0, "are: ") + 5)'`
archtectures=(`echo $archtectureStr`)
tempFileStr=""
for i in `seq 1 ${#archtectures[@]}`
do