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
// 設定 | |
// SlackのBot Tokenをセット | |
// see https://note.com/crefil/n/n2b68b3c4aa6b | |
const slackBotToken = PropertiesService.getScriptProperties().getProperty("SLACK_BOT_TOKEN"); | |
// SlackチャンネルIDまたはチャンネル名 | |
const channel = ''; | |
const slackUserIds = { | |
'名前': 'ID' | |
} |
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
//> using dep com.lihaoyi::pprint:0.8.1 | |
//> using dep io.circe::circe-core::0.14.6 | |
//> using dep io.circe::circe-generic::0.14.6 | |
import io.circe._ | |
import io.circe.generic.semiauto._ | |
import io.circe.Json._ | |
import pprint._ | |
final case class Cat(name: String) | |
object Cat: |
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
from flask import Flask, jsonify | |
import boto3 | |
import json | |
import requests | |
import os | |
import random | |
import time | |
# Add imports for OTel components into the application | |
from opentelemetry import metrics |
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
from flask import Flask, jsonify | |
from flask.logging import default_handler | |
import logging | |
import logging.handlers | |
import requests | |
from requests.exceptions import Timeout | |
import time | |
import random | |
import os | |
import json |
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
//> using dep org.typelevel::cats-effect:2.5.5 | |
//> using dep com.lihaoyi::pprint:0.8.1 | |
import cats.effect._ | |
import cats.Monad | |
import cats.implicits._ | |
def findParitialQuote[F[_]: Sync]: F[String] = | |
Sync[F] | |
.delay(pprint.pprintln("All I kept thinking about, over and over, was...")) | |
.as("You can't live forever") |
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
//> using dep org.typelevel::cats-core:2.9.0 | |
//> using dep com.lihaoyi::pprint:0.8.1 | |
//> using dep dev.optics::monocle-core:3.2.0 | |
//> using dep dev.optics::monocle-macro:3.2.0 | |
import cats.implicits.* | |
import cats.data.EitherT | |
import cats.{Monad, Functor, Id} | |
import monocle.Lens | |
import monocle.macros.GenLens |
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
data PHeap a = Empty | Node a [PHeap a] | |
mergePairs :: Ord a => [PHeap a] -> PHeap a | |
mergePairs [] = Empty | |
mergePairs [h] = h | |
mergePairs (h1:h2:hs) = merge (merge h1 h2) (mergePairs hs) | |
merge :: Ord a => PHeap a -> PHeap a -> PHeap a | |
merge h Empty = h | |
merge Empty h = h |
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 java.security.MessageDigest | |
import java.text.SimpleDateFormat | |
import java.util.{Date, TimeZone} | |
object AwsV4Signer { | |
def sign(accessKey: String, secretKey: String, method: String, url: String, payload: String): Map[String, String] = { | |
val timestamp = getFormattedTimestamp() | |
val credentialsScope = getCredentialsScope(timestamp) | |
val canonicalRequest = getCanonicalRequest(method, url, payload, credentialsScope) | |
val hashedCanonicalRequest = hash(canonicalRequest) |
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 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
require "fluent/plugin/out_datadog" | |
require "ougai" | |
require "json" | |
DD_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXX" | |
DD_DEFAULT_HTTP_ENDPOINT = "http-intake.logs.datadoghq.com" | |
COMPRESSION_LEVEL = 6 | |
class DDBenchClient | |
attr_reader :logger, :dd, :client |
NewerOlder