Skip to content

Instantly share code, notes, and snippets.

かとちん tkatochin

Block or report user

Report or block tkatochin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tkatochin
tkatochin / gdata-deploy.sh
Created Mar 18, 2011
gdata-java-clientをダウンロードして全てのライブラリをデプロイするシェル。
View gdata-deploy.sh
#!/bin/sh
if [ $# -ne 3 ]; then
echo "usage...: $0 gdata-version repository-url repository-id"
echo "ex.) $0 1.43.0 http://mylocal-nexus/content/repositories/thirdparty deploy-thirdparty"
exit 1
fi
curl -O http://gdata-java-client.googlecode.com/files/gdata-src.java-$1.zip
unzip gdata-src.java-$1.zip
cd gdata/java/src
zip -r ../lib/sources.jar com
@tkatochin
tkatochin / working-summary.py
Last active Sep 30, 2015
Macのキーとマウスのログから日々の稼働開始〜終了時間を出力する
View working-summary.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# こちら↓の成果のログから稼働開始〜終了時間を出力する
# http://qiita.com/edvakf@github/items/721afa8d2e69c556ba64
import sys
import os
import glob
import datetime
from datetime import datetime, timedelta
@tkatochin
tkatochin / testgadget.xml
Created Feb 24, 2012
Googleカレンダーで使用すると週・月以外で落ちるサンプルガジェット
View testgadget.xml
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="CanvasAndPrefSetSample" author="katochin">
<Require feature="setprefs"/>
<Require feature="views"/>
</ModulePrefs>
<UserPref datatype="hidden" display_name="test" name="testPref" />
<Content type="html" view="canvas">
<![CDATA[<!DOCTYPE html>
<head>
@tkatochin
tkatochin / __deploy_back.sh
Created Feb 24, 2012
自動的に認証しつつappgngineにGAE/Javaアプリをmvnビルド後にデプロイするシェル。詳細→ http://tkatochin.hatenablog.com/entry/2012/02/24/173853
View __deploy_back.sh
#!/bin/sh
echo mvn -P $1 $2 $3 $4 $5 -DdownloadSources=true -Dgwt.compile.skip=true eclipse:eclipse package
mvn -P $1 $2 $3 $4 $5 -DdownloadSources=true -Dgwt.compiler.skip=true eclipse:eclipse package
RETVAL=$?
if [ $RETVAL -eq 0 ]
then(
expect -c "
set timeout -1
spawn appcfg.sh --email=$GAE_USER --passin backends update war
expect Password\ for\ $GAE_USER:\ ; send \"$GAE_PASS\r\"
@tkatochin
tkatochin / mvn
Created Oct 8, 2015
プロジェクトごとにローカルリポジトリを切り替えられることができるようにしたmvn
View mvn
#!/bin/sh
export repo_path=
export ancestor=.
while [ "/" != "`cd $ancestor;pwd`" -a ! -d $ancestor/.m2/repository ]; do
export ancestor=../${ancestor}
done
if [ -d $ancestor/.m2/repository ]; then
export repo_path=`cd $ancestor/.m2/repository;pwd`
else
@tkatochin
tkatochin / isUsingMultiAccounts.js
Created Sep 4, 2013
Googleアプリにスクリプトレットなどで流し込んで、マルチアカウントユーザーか否かを判断する
View isUsingMultiAccounts.js
// to be loaded AddToStringPrototypeStartsWithAndEndsWith.js
isMultiLogoned = function () {
tags = document.getElementsByTagName("a");
for (var i = 0; i < tags.length; i++) {
if (tags[i].rel == "noreferrer") {
if (tags[i].href != "" && (tags[i].href.indexOf("&authUser=") || tags[i].href.indexOf("?authUser="))) {
return true;
}
}
}
View AddToStringPrototypeStartsWithAndEndsWith.js
String.prototype.startsWith = function(prefix) {
return this.lastIndexOf(prefix, 0) == 0;
};
String.prototype.endsWith = function(suffix) {
return this.lastIndexOf(suffix) == this.length-suffix.length;
}
@tkatochin
tkatochin / JSONP special
Created Sep 10, 2013
NeoCatさんの「JSONPのエラー検知(&リトライ)可能版。」いいね! http://d.hatena.ne.jp/NeoCat/20110206/1296934235 ※charset=utf-8だけ足した。
View JSONP special
// Thanks NeoCat http://d.hatena.ne.jp/NeoCat/20110206/1296934235
window.xds = {
load: function(url, callback, onerror, retry, callback_key) {
var ifr = document.createElement("iframe");
ifr.style.display = "none";
document.body.appendChild(ifr);
var d = ifr.contentWindow.document;
var cnt = 0;
ifr[ifr.readyState/*IE*/ ? "onreadystatechange" : "onload"] = function() {
if (this.readyState && this.readyState != 'complete' || cnt++) return;
@tkatochin
tkatochin / pf2gwtcnst.sh
Created Dec 28, 2015
Create java file for constants interface for GWT from property file
View pf2gwtcnst.sh
#!/bin/sh
allargs=$@
extendsType=com.google.gwt.i18n.client.Constants
if [[ $allargs == *"--extends="* ]]; then
echo " --extends=constants-class-name Constantsの拡張クラスを指定できます。指定がない場合はConstantsになります。"
extendsType=`echo $allargs | sed -e "s/.*--extends=\\([a-zA-Z0-9_.]*\\).*/\\1/g"`
allargs=`echo $allargs | sed -e "s/\\(.*\\)\\(--extends=[a-zA-Z0-9_.]*\\)\\(.*\\)/\\1\\3/g"`
fi
@tkatochin
tkatochin / install_appengine-java-sdk.sh
Last active Feb 3, 2016
GAEのSDKを自動ダウンロードして展開するスクリプト (Mac)
View install_appengine-java-sdk.sh
#!/bin/sh
if [ -z $1 ]; then
echo パラメータに appengine sdkのバージョンを指定してね!
exit 1
fi
DRYRUN=
if [ $1 = --dry-run ]; then
shift
DRYRUN=on
fi
You can’t perform that action at this time.