This file contains hidden or 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; | |
| } |
This file contains hidden or 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" |
This file contains hidden or 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 |
This file contains hidden or 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' |
This file contains hidden or 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('?')); |
This file contains hidden or 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 |
This file contains hidden or 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}, |
This file contains hidden or 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' | |
| }; |
This file contains hidden or 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}`);})(); |
This file contains hidden or 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