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
const TARGET_URL = 'https://example.com'; | |
const CARBON_API_URL = `https://api.websitecarbon.com/site?url=${TARGET_URL}`; | |
/** | |
* APIからデータを取得し、スプレッドシートに記録する | |
*/ | |
function main() { | |
const response = callApi(CARBON_API_URL); | |
if (response !== null) { | |
writeToSpreadsheet(response); |
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
/** | |
* This script calculates biorhythms based on a given birthday and adds them as events | |
* to a specified Google Calendar. Each event's title includes the biorhythm type and its value. | |
* It is designed to run on the 1st of every month and is idempotent, meaning it can run | |
* multiple times a month without causing duplicate entries. It deletes any existing biorhythm | |
* events for the month before adding new ones. | |
* | |
* Cycles: | |
* - Physical: 23 days | |
* - Emotional: 28 days |
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
/** | |
* Refer to https://tech.affordigitalife.com/oura-api-sleep-log/ | |
*/ | |
function main() { | |
const days = 10; | |
for (let i = 0; i < days; i++) { | |
let today = new Date() | |
today.setDate(today.getDate() - i) | |
let yesterday = new Date() | |
yesterday.setDate(yesterday.getDate() - (i + 1)) |
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
location.pathname.replace(/\/+$/, "").split('/').pop(); |
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 | |
/** | |
* JPEGのEXIF情報を削除します。 | |
* 元画像は削除した上で変換後のファイルを置き換えます。 | |
* @param string $path 画像パス | |
* @return boolean | |
*/ | |
function removeExif($path) { | |
$status = true; | |
list(, , $type) = getimagesize($path); |
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
image: python:2 | |
stages: | |
- deploy | |
before_script: | |
- curl -s https://shopify.github.io/themekit/scripts/install.py | python | |
deploy_staging: | |
stage: deploy |
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 | |
namespace App\Shell\Task; | |
use Bake\Shell\Task\ModelTask; | |
use Cake\Console\Shell; | |
use Cake\Core\Configure; | |
use Cake\ORM\TableRegistry; | |
/** | |
* Class GenerationGapModelTask |
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 | |
namespace App\Command; | |
use Cake\Console\Arguments; | |
use Cake\Console\Command; | |
use Cake\Console\ConsoleIo; | |
use Cake\Console\ConsoleOptionParser; | |
use Cake\Datasource\ConnectionManager; | |
/** |
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
/** | |
* WebStorageでQueueを管理するクラス | |
* @class WebStorageQueue | |
*/ | |
;WebStorageQueue = (function() { | |
'use strict'; | |
function WebStorageQueue(storage, key) { | |
if(!storage) { | |
throw new Error('Storageオブジェクトが取得できませんでした。'); | |
} |
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 | |
App::uses('HtmlHelper', 'View/Helper'); | |
class MyHtmlHelper extends HtmlHelper { | |
/** | |
* microdata属性対応版 | |
* @link https://support.google.com/webmasters/answer/185417?hl=en | |
* @see HtmlHelper::getCrumbList() | |
*/ |
NewerOlder