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
/** | |
* 設定した前週比の下落幅パーセントを下回った場合、チャットにアラートするGASスクリプト。 | |
* | |
* 決まった形式のGoogleSpreadSheetの情報を元に、指定銘柄の前週比(スケジューリングで一週間ごとに実行)を記録、 | |
* 指定した比率以下に下落した場合、Discordのチャンネルに通知する。 | |
* | |
* 環境変数(スクリプトプロパティに設定する) | |
* - SPREAD_SHEET_URL: データ&設定を仕込んだGoogleSpreadSheetのURL | |
* - DISCORD_ENDPOINT: Discordの特定チャンネルへのWebHook URL | |
*/ |
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 java.io.FileNotFoundException; | |
import java.io.PrintWriter; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class FizzBuzzSourceGenerator { | |
public static void main(String[] args) throws FileNotFoundException { | |
String sourceText = "public class FizzBuzz {\n\tpublic static void main(String[] args) {" | |
+ generateOutputPart() | |
+ "\n\t}\n}"; |
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 | |
for i in $(find ./ -name '*.cs') ; do | |
nkf --overwrite -d --oc=UTF-8-BOM $i | |
done |
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 org.junit.jupiter.api.Test; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.Map; | |
import java.util.UUID; | |
import java.util.function.Predicate; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |
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 com.kazuhitom.demo.presentation.controller; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.web.bind.annotation.*; | |
import org.springframework.web.multipart.MultipartFile; | |
import java.io.IOException; | |
import java.io.InputStream; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Web Speech API Speech Synthesis の基本的なサンプル</title> | |
</head> | |
<body> | |
<h1> Web Speech API Speech Synthesis の基本的なサンプル</h1> | |
<p><textarea id="speachText">日本語でしゃべります。ro-majidemo,ikemasu.</textarea></p> | |
<p> | |
rate: |
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
/** | |
* JoySoundの歌唱履歴ページを定期的にポーリングし、追加があればSpreadSheetに書きつつ、TwitterへつぶやくGASスクリプト。 | |
* | |
* Usage | |
* 1. GoogleAppScriptに新たにスクリプトを作り、このソースを貼る。 | |
* 2. ファイル->プロジェクトのプロパティ->スクリプトのプロパティを開き、以下の変数を設定する。 | |
* - joysound_id : JoySoundの「うたスキ(https://www.joysound.com/utasuki)」にログインするためのID | |
* - joysound_password : 上記のパスワード | |
* - spreadsheet_id : GoogleSpreadSheetのID | |
* - twitter_api_key : TwitterのAPI key |
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
export default class Sreializer { | |
private readonly constructors: ObjectConstructor[]; | |
constructor(...constructors: any) { | |
this.constructors = constructors; | |
} | |
public serialize(target: any): string { | |
this.addClassNameProperty(target); // TODO 元のオブジェクトを上書きまくるのでなんとかしたい | |
return JSON.stringify(target, null, 4); |
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 | |
IP_HEAD='192.168.1.' | |
echo ${IP_HEAD}{1..254} \ | |
| xargs -P256 -n1 ping -s1 -c1 -W1 \ | |
| grep ttl | |
exit 0 |
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
# k8sのアプリケーション群に与える環境変数のテンプレート | |
# | |
# 各環境ではこれを元として、書き換えたものを配置・参照するように。 | |
# | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: thisproject-config | |
data: | |
ENVIRONMENT: local # 環境名 |
NewerOlder