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-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 / chat-20230321.md
Last active April 24, 2023 06:32
スタックトレースをログに出力する際のセキュリティ上の問題点を教えてください

Spiegel

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

ChatGPT

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

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

@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Last active November 16, 2018 23:30
日能研の問題をGo言語で力づくで解いてみた(2018/11) ref: https://qiita.com/spiegel-im-spiegel/items/90332789f8a6f98c670d
package main
import "fmt"
func Permutations(cards []int) <-chan []int {
ch := make(chan []int)
go func() {
defer close(ch)
perm(ch, make([]int, 0, len(cards)), cards)
}()
@spiegel-im-spiegel
spiegel-im-spiegel / .goreleaser.yml
Last active October 21, 2018 04:23
GOPATH モードからモジュール対応モードへ移行せよ ref: https://qiita.com/spiegel-im-spiegel/items/5cb1587cb55d6f6a34d7
builds:
- env:
- GO111MODULE=on
@spiegel-im-spiegel
spiegel-im-spiegel / config.cson
Created April 12, 2018 05:13
ATOM Editor で拡張子に言語を関連付ける ref: https://qiita.com/spiegel-im-spiegel/items/bbd8269588af251213d9
"*":
core:
customFileTypes:
"source.perl6": [
"pl"
"cgi"
]
@spiegel-im-spiegel
spiegel-im-spiegel / file0.pl
Last active January 23, 2018 05:18
Go 言語でも (a==1 && a==2 && a==3) を true にしてみたい(クソリプ編) ref: https://qiita.com/spiegel-im-spiegel/items/16b15d0c646e2a0e3e7d
use strict;
use warnings;
my $a = 1;
my @a = (1, 2);
sub a { 3 };
if ($a == 1 and @a == 2 and &a == 3) {
print "True!\n";
}
@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.go
Last active October 27, 2017 00:05
バイナリデータを Golang の []byte リテラル表記に変換する簡単なお仕事 ref: http://qiita.com/spiegel-im-spiegel/items/272c1b8c01eb287059e0
package godump
import (
"bytes"
"fmt"
"io"
)
//DumpBytes returns []bytes literal string
func DumpBytes(r io.Reader, name string) (io.Reader, error) {
@spiegel-im-spiegel
spiegel-im-spiegel / file0.go
Created October 19, 2017 10:56
バイト列を整数に変換する簡単なお仕事メモ(Go言語) ref: http://qiita.com/spiegel-im-spiegel/items/1eb8bcb44c946aa5920d
package main
import (
"encoding/binary"
"fmt"
)
func main() {
octets := []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}