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
'use strict'; | |
exports.handler = (event, context, callback) => { | |
const host = '<REPLARE_TO_YOUR_HOST>'; // e.g. https://michimani.net | |
// Extract the request from the CloudFront event that is sent to Lambda@Edge | |
var request = event.Records[0].cf.request; | |
// Extract the URI from the request | |
var requestUri = request.uri; |
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 titleTag=document.getElementsByTagName("title"),pageUrl=location.href;let pageTitle=pageUrl;titleTag.length>0&&titleTag[0].innerHTML!==""&&(pageTitle=titleTag[0].innerHTML);const md=`[${pageTitle}](${pageUrl})`;navigator.clipboard&&navigator.clipboard.writeText(md);})(); |
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 |
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' |
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}, |
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' | |
}; |
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}`);})(); |
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 |
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 ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/dynamodb" |
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
""" Get weekly page view summary. """ | |
from apiclient.discovery import build | |
from oauth2client.service_account import ServiceAccountCredentials | |
import json | |
import re | |
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly'] | |
KEY_FILE_LOCATION = 'client_secrets.json' |