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
type Method = 'get' | 'post' | 'patch' | 'put' | 'delete' | 'head' | |
type IdempotentMethod = 'get' | 'head' | 'delete' | |
type MutationMethod = Exclude<Method, IdempotentMethod> | |
type IdempotentClient = (path: string, query?: URLSearchParams, headers?: HeadersInit) => Promise<Response> | |
type MutationClient = (path: string, body: any, headers?: HeadersInit) => Promise<Response> | |
type IdempotentClients = Record<IdempotentMethod, IdempotentClient> | |
type MutationClients = Record<MutationMethod, MutationClient> | |
type _RequestClient = IdempotentClients & MutationClients |
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
#!/bin/bash | |
# aws-cli, jq, GNU-sed are required | |
set -euC -o pipefail | |
# Shortcut for get-log-events command. | |
get_log_events() { | |
local cmdArgs="--start-from-head --limit 100 --log-group-name ${1} --log-stream-name ${2}" | |
[[ -n ${3:-} ]] && cmdArgs="${cmdArgs} --next-token ${3}" | |
aws logs get-log-events ${cmdArgs} | |
} |
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 | |
/** | |
* Googlebot からのアクセスかどうかを厳密にチェックするクラス。 | |
* 使い方: GoogleBotStrictVerifier::isGoogleBot() | |
*/ | |
class GoogleBotStrictVerifier | |
{ | |
/** | |
* User-Agent および IP の逆引きから Googlebot かどうかを判定する。 | |
* @return boolean |
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
if (process.argv.length < 3) { | |
throw `Usage: ${process.argv[1]} path_prefix` | |
} | |
const PATH_PREFIX = process.argv[2] | |
const path = require('path') | |
const AWS = require('aws-sdk') | |
const ssm = new AWS.SSM() | |
function getParametersByPath(nextToken, callback) { |
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(cmd, fire) { | |
var keys = []; | |
var l = cmd.length, CMD = cmd.join(','); | |
$(document).on('keydown', function(event) { | |
keys.push(event.which); | |
if (keys.length < l) return true; | |
if (keys.join(',') === CMD) fire(); | |
keys = []; | |
}); |