Skip to content

Instantly share code, notes, and snippets.

View osamingo's full-sized avatar
🧑‍💻

Osamu TONOMORI osamingo

🧑‍💻
View GitHub Profile
@osamingo
osamingo / main.gs
Last active August 29, 2015 14:05
GoogleSpreadSheetをGoogleAppsScript使用して、JSON APIにする ref: http://qiita.com/osamingo/items/c9e6fcbf7f40c1d35931
var fileName = 'hogefuga-master.json';
var folderId = '<GoogleドライブのフォルダID>';
function doGet(e) {
return ContentService.createTextOutput(DriveApp.getFolderById(folderId).getFilesByName(fileName).next().getBlob().getDataAsString()).setMimeType(ContentService.MimeType.JSON);
}
function onOpen() {
SpreadsheetApp.getActiveSpreadsheet().addMenu('マスタ更新', [{name: 'JSON出力', functionName: 'updateMasterData'}]);
}
@osamingo
osamingo / build.gradle
Created August 29, 2014 04:36
Submoduleの一部をassetsとして扱い、apkに含める方法 ref: http://qiita.com/osamingo/items/41deaf2c5c66a7296ed5
android {
sourceSets {
main {
assets.srcDirs = ['src/main/assets/dest']
}
}
}
@osamingo
osamingo / file0.groovy
Created May 21, 2014 07:42
logbackの設定をgroovyでやってみた。(logback.groovy) ref: http://qiita.com/osamingo/items/21a043fd3fd6db8537fa
import static ch.qos.logback.classic.Level.*
import java.nio.charset.Charset
import ch.qos.logback.core.ConsoleAppender
import ch.qos.logback.core.rolling.RollingFileAppender
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
import ch.qos.logback.core.status.OnConsoleStatusListener
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
@osamingo
osamingo / gist:10524592
Created April 12, 2014 08:26
https://github.com/trending から言語一覧をひぱってくるsnippet
$.map($('.select-menu-list .select-menu-item-text').toArray(), function(elem) {
return elem.innerText;
});
@osamingo
osamingo / file0.txt
Created October 17, 2013 02:44
JRubyでRuby on Rails4を動かす ref: http://qiita.com/osamingo/items/f330ce361c8604fd98ea
$ jruby -S bundle exec rails server
@osamingo
osamingo / gist:5908328
Created July 2, 2013 10:40
svn2git用のauthors.txtを自動作成するワンライナー - checkoutしたディレクトリ内で実行
svn log --xml | grep -P "^<author" | sort -u | perl -pe 's/<author>(.*?)<\/author>/$1 = $1 <$1\@hoge.jp>/' | sed -e "s/_/-/2" > authors.txt