This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// global にしておく | |
var checkBoxArray = ['幼少期(0~6歳頃)', | |
'学童期(6~12歳頃)', | |
'青年期(12~25歳頃)', | |
'成人期(25~40歳頃)', | |
'中年期(40~65歳頃)', | |
'老年期(65歳~)']; | |
function doGet() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Script-as-app template. | |
function doGet() { | |
// GUIビルダーで初期表示 | |
var app = UiApp.createApplication(); | |
var myGui = app.loadComponent("MyGui"); | |
app.add(myGui); | |
// 初期値設定 | |
UserProperties.setProperty("red" ,false); | |
UserProperties.setProperty("blue" ,false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves all inbox threads and logs the respective subject lines. | |
* For more information on using the GMail API, see | |
* https://developers.google.com/apps-script/class_gmailapp | |
*/ | |
function processInbox() { | |
// get all threads in inbox | |
var threads = GmailApp.getInboxThreads(); | |
for (var i = 0; i < threads.length; i++) { | |
// get all messages in a given thread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves all inbox threads and logs the respective subject lines. | |
* For more information on using the GMail API, see | |
* https://developers.google.com/apps-script/class_gmailapp | |
*/ | |
function processInbox() { | |
// get all threads in inbox | |
threads = GmailApp.getSpamThreads(); | |
for (var i = 0; i < threads.length; i++) { | |
// get all messages in a given thread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_xdebug_shutdown() { | |
$result = xdebug_get_code_coverage(); | |
foreach($result as $file => $covers) { | |
$lines = file($file); | |
if (!isCoverageTargetFile($file)) { | |
continue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* スプレッドシート内のデータからXMLデータを生成します | |
* 1行目にXMLのタグ名を入れると、それに応じてデータをXML化します | |
* XMLオブジェクトを使うことで、& -> & などの処理をAppsScript側に任せています | |
* | |
* 例) | |
* | |
* id | name | no | |
* 1 | miura | 18 | |
* 2 | blanco | 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GoogleAnalytics_() { | |
this.apiBase = "https://www.googleapis.com/analytics/v3/data/ga"; | |
this.tokenUrl = "https://accounts.google.com/o/oauth2/token"; | |
/** | |
* 認証用のヘッダーを作る | |
*/ | |
this.buildAuthorizationHeader = function(token) { | |
headers = { | |
"Authorization" : "Bearer" + " " + token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Util_() { | |
/** | |
* mb_strwidth | |
* @param String | |
* @return int | |
* @see http://php.net/manual/ja/function.mb-strwidth.php | |
*/ | |
this.mb_strwidth = function(str){ | |
var i=0,l=str.length,c='',length=0; | |
for(;i<l;i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function padZero(v) { | |
return v < 10 ? "0" + new String(v) : new String(v); | |
} | |
function getBars(str) { | |
var result = 0; | |
var bars = {0: 6, 1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 4, 8: 7, 9: 6}; | |
for (var i=0; i < str.length; i++) { | |
result += bars[str[i]]; | |
} | |
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
while($line=fgets(STDIN)) | |
{ | |
echo trim(solve($line)) . "\n"; | |
} | |
function solve($str) { | |
for ($i = 0; $i < 26; $i++) { |
OlderNewer