View cf2_for_hugo.js
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 handler(event) { | |
var host = '<REPLARE_TO_YOUR_HOST>'; // e.g. https://michimani.net | |
var request = event.request; | |
var requestUri = request.uri; | |
// do not anything when requesting to top page | |
if (requestUri == '' || requestUri == '/') { | |
return request; | |
} |
View main.go
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
package main | |
import ( | |
"context" | |
_ "embed" | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/aws/aws-sdk-go-v2/aws" |
View issue-acm-certificate.sh
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 | |
set -e | |
if [ $# != 3 ] || [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]; then | |
echo -e "Three parameters are required | |
1st - string: Hosted Domain Name on Route 53 (e.g. example.com) | |
2nd - string: Domain Name for Certificate (e.g. sub.mexample.com) | |
3rd - string: Target Region (e.g. us-east-1) | |
example command |
View translate_by_deepl.js
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
javascript: (function () { | |
var API_KEY = '<your_deel_api_key>'; | |
var DEEPL_TRANSLATE_EP = 'https://api.deepl.com/v2/translate'; | |
var TARGET_LANBG = 'JA'; | |
var bodyHtml = document.getElementsByTagName('body')[0].innerHTML; | |
var params = { | |
'auth_key': API_KEY, | |
'text': bodyHtml, | |
'target_lang': TARGET_LANBG, | |
'tag_handling': 'xml' |
View main.js
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 () { | |
const _d = document; | |
const imgElemList = _d.querySelectorAll('ol.pg-photo__webImageList a img'); | |
if (imgElemList.length == 0) { | |
alert('Images not found.'); | |
return; | |
} | |
imgElemList.forEach((e, i) => { | |
let imgSrc = e.getAttribute('src'); | |
imgSrc = imgSrc.slice(0, imgSrc.indexOf('?')); |
View detect_smash_bros_sp_power_v2.py
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
import boto3 | |
import cv2 | |
import datetime | |
import hashlib | |
import json | |
import os | |
import re | |
import sys | |
import time |
View detect_smash_bros_sp_power.py
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
import boto3 | |
import sys | |
reko = boto3.client('rekognition') | |
target_area = { | |
'A': {'X': 0.785039062, 'Y': 0.639347222}, | |
'B': {'X': 0.950203125, 'Y': 0.639347222}, | |
'C': {'X': 0.950203125, 'Y': 0.737263889}, | |
'D': {'X': 0.785039062, 'Y': 0.737263889}, |
View set_slack_status.js
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 slackUserId = 'XXXXXXXX'; // your user ID | |
const slackApiToken = 'xoxp-******-*******-******'; // your API token | |
const slackSetStatusUrl = 'https://slack.com/api/users.profile.set'; | |
function changeSlackStatus(emoji, message) { | |
const headers = { | |
'Authorization': 'Bearer ' + slackApiToken, | |
'X-Slack-User': slackUserId, | |
'COntent-Type': 'application/json; charset=utf-8' | |
}; |
View display_cstimer_results
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
javascript:(function(){const statsSelector="#stats div.statc table.sumtable.table tr";var stats=document.querySelectorAll(statsSelector),statsTitle="",statsValue="";stats.forEach(t=>{let e=t.querySelector("th").innerText;if(""!=e){"time"==e&&(e="1"),""!=statsTitle&&(statsTitle+="/"),statsTitle+=e;let s=t.querySelectorAll("td")[1].innerText;""!=statsValue&&(statsValue+="/"),statsValue+=s}});alert(`${statsTitle} = ${statsValue}`);})(); |
View lambda_at_1st_day__main.go
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
package main | |
import ( | |
"context" | |
"time" | |
) | |
// IsFirstDay is function to check today is the 1st day of month in JST | |
func IsFirstDay() bool { | |
var isFirstDay bool = false |
NewerOlder