Skip to content

Instantly share code, notes, and snippets.

View spiegel-im-spiegel's full-sized avatar
😀
being hired

Spiegel spiegel-im-spiegel

😀
being hired
View GitHub Profile
@spiegel-im-spiegel
spiegel-im-spiegel / chat-20230321.md
Last active April 24, 2023 06:32
スタックトレースをログに出力する際のセキュリティ上の問題点を教えてください

Spiegel

スタックトレースをログに出力する際のセキュリティ上の問題点を教えてください。

ChatGPT

  1. 機密情報の漏洩:スタックトレースには、クラス名、メソッド名、変数名、およびその値など、プライバシーに関する情報が含まれています。これらの情報がログに残されていると、攻撃者が情報を収集し、悪用する可能性があります。

  2. 脆弱性の暴露:スタックトレースには、アプリケーションの脆弱性が含まれている場合があり、攻撃者に攻撃するための情報を提供する可能性があります。 攻撃者がこの情報を利用して攻撃することができます。

@spiegel-im-spiegel
spiegel-im-spiegel / chat-20230330.md
Created March 29, 2023 23:10
教えて GPT 先生:万物理論について

Chat with GPT

  • model: gpt-3.5-turbo-0301

Spiegel

万物理論について教えてください

GPT 先生

@spiegel-im-spiegel
spiegel-im-spiegel / chat-20230327.md
Created March 27, 2023 02:23
ChatGPT に新しく作るツールの名前を考えてもらった

Spiegel

OpenAI API を使い, CUI ターミナル上で ChatGPT を模したテキストベースのチャットができる。コマンドラインツールを作ろうと思います。コマンド名で短く分かりやすい名前のアイデアはありませんか?

ChatGPT

いくつかのアイデアをいくつか挙げてみました:

  1. chatgpt : 直感的で明確な名前です。ユーザーはこれが何をするかすぐに理解できます。
  2. gpt-chat : 簡潔な名前で、OpenAIのAPIとその用途に関連しています。
@spiegel-im-spiegel
spiegel-im-spiegel / init.coffee
Last active October 27, 2020 06:03
ATOM Editor の設定(カスタマイズ, Windows 環境用)
################################################################
# miscellaneous functions
insertText = (str) ->
return unless editor = atom.workspace.getActiveTextEditor()
selection = editor.getLastSelection()
selection.insertText(str)
################################################################
# 現在日時を挿入するコマンドを追加
# refs https://github.com/dannyfritz/atom-date
@spiegel-im-spiegel
spiegel-im-spiegel / .editorconfig
Last active September 22, 2020 05:16
行末の空白は EditorConfig で始末しましょう ref: https://qiita.com/spiegel-im-spiegel/items/a1b4d1ad2a6693ae33e4
root = true
[*]
end_of_line = lf
charset = utf-8
indent_style = tab
indent_size = 4
trim_trailing_whitespace = false
insert_final_newline = false
@spiegel-im-spiegel
spiegel-im-spiegel / file2.txt
Last active March 1, 2020 02:35
Golang の文字列連結はどちらが速い? ref: https://qiita.com/spiegel-im-spiegel/items/16ab7dabbd0749281227
C:>go test -bench WriteBuffer -benchmen
testing: warning: no tests to run
PASS
BenchmarkWriteBuffer1-4 100000 12220 ns/op 28864 B/op 11 allocs/op
BenchmarkWriteBuffer1Cap128-4 100000 11620 ns/op 28800 B/op 10 allocs/op
BenchmarkWriteBuffer1Cap1K-4 200000 11605 ns/op 27904 B/op 7 allocs/op
BenchmarkWriteBuffer2-4 100000 14200 ns/op 25568 B/op 9 allocs/op
BenchmarkWriteBuffer2Cap128-4 100000 15790 ns/op 26800 B/op 8 allocs/op
BenchmarkWriteBuffer2Cap1K-4 200000 10305 ns/op 17520 B/op 5 allocs/op
ok join 13.260s
//********************************************************************************************
//note用 目次生成関数
// noteのRSSデータから Title, URL, Date Created 情報を抽出し(Google spreadsheets で抽出する)
// 目次用の HTML 要素を抽出する
//
// Written and revised by Spiegel,2014; http://www.baldanders.info/spiegel/profile/
// but, this document code is under CC0.
// https://creativecommons.org/publicdomain/zero/1.0/
//********************************************************************************************
function getNoteTocHTML(){
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Last active May 27, 2019 12:16
Go 言語で改行コードを変換する(正規表現以外の解) ref: https://qiita.com/spiegel-im-spiegel/items/f1cc014ecb233afaa8af
package main
import (
"fmt"
"regexp"
)
var regxNewline = regexp.MustCompile(`\r\n|\r|\n`) //throw panic if fail
func convNewline(str, nlcode string) string {
@spiegel-im-spiegel
spiegel-im-spiegel / file0.txt
Last active May 1, 2019 01:19
そろそろ真面目に Golang 開発環境について考える — GOPATH 汚染問題 ref: http://qiita.com/spiegel-im-spiegel/items/73ebc684b5807277b7e2
SET GOPATH=C:\golib;C:\workspace\project1;C:\workspace\project1;...
C:> go get -v golang.org/x/tools/cmd/vet
C:> go get -v golang.org/x/tools/cmd/goimports
C:> go get -v golang.org/x/tools/cmd/oracle
C:> go get -v github.com/golang/lint/golint
C:> go get -v github.com/nsf/gocode
C:> go get -v github.com/rogpeppe/godef