Skip to content

Instantly share code, notes, and snippets.

View Ancient-Scapes's full-sized avatar
👻

Scapes Ancient-Scapes

👻
View GitHub Profile
@Ancient-Scapes
Ancient-Scapes / gpt4_to_slack_wehhook.gs
Created April 13, 2023 17:45
GPT-4 APIからSlack Webhookに投稿する奴
function generateResponse() {
// OpenAI APIキーとChatGPTのエンドポイントを設定する
const openaiApiKey = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const openaiEndpoint = "https://api.openai.com/v1/chat/completions";
// OpenAIに送信するテキストを設定する
const prompt = `xxxxxx`;
// OpenAIにリクエストを送信する
const payload = {
@Ancient-Scapes
Ancient-Scapes / problemAndReason.txt
Created March 19, 2023 10:55
[GPT-4] 何らかの問題に対して、なぜそうなっているかを深堀りして問題と理由を繰り返し出力するプロンプト
あなたはGo言語のインタプリタとして振る舞ってください。以下のgo言語のコードを実行して結果を出力してください。
なお、定義されていない関数は内容を推測した処理を行い実行してください。
また、返答内容はこのプログラムの実行結果のみにしてください。
```
# resolveProblemは受け取った文字列の内容を解決するための手法を示したstringを返却します
# whyProblemは受け取った文字列がどうしてそうなっているかの原因を推測したstringを返却します
var prompt = "ビートマニアの皆伝がなかなか受からない"
var reason = "個人差のある曲が上手くできない、ソフランが苦手、冥の低速縦連が無理"
@Ancient-Scapes
Ancient-Scapes / createPrompt.txt
Created March 19, 2023 10:13
[GPT-4] 何らかの欲求から、それを解決するためのプロンプトをn個生成するプロンプト
あなたはGo言語のインタプリタとして振る舞ってください。以下のgo言語のコードを実行して結果を出力してください。
なお、定義されていない関数は内容を推測した処理を行い実行してください。
また、返答内容はこのプログラムの実行結果のみにしてください。
```
# createPromptはqueryの文字列を基に、その悩みを解決するためのprompt文字列を返却します
var query = "痩せたい"
func main() {
for i := 1; i <= 20; i++ {
@Ancient-Scapes
Ancient-Scapes / shell
Created July 6, 2020 08:42
check project not MIT licenses with license-checker
license-checker --exclude 'MIT' --production --json --out ./license.json
@Ancient-Scapes
Ancient-Scapes / .zshrc
Created June 24, 2020 17:58
remote repository settiing alias with https(rename Ancient-Scapes your git user name )
## add remote repository with https
function gra () { git remote add origin https://Ancient-Scapes@github.com/Ancient-Scapes/$@.git }
## set remote repository with https
function grs () { git remote set-url origin https://Ancient-Scapes@github.com/Ancient-Scapes/$@.git }
@Ancient-Scapes
Ancient-Scapes / parseCsv.js
Created June 22, 2020 22:23
parse local csv file with node.js
const papa = require('papaparse')
const fs = require('fs')
const path = require('path')
const config = {
worker: true,
complete: (results) => {
console.log(results.data)
// write after process...
},
@Ancient-Scapes
Ancient-Scapes / settings.json
Created June 20, 2020 06:16
My VSCode Setting
{
"workbench.iconTheme": "material-icon-theme",
"explorer.confirmDelete": false,
"window.zoomLevel": 1,
"workbench.colorTheme": "Ariake Dark",
"workbench.activityBar.visible": false,
"editor.minimap.enabled": false,
"workbench.statusBar.visible": true,
"powermode.enabled":true,
"powermode.presets":"fireworks",
@Ancient-Scapes
Ancient-Scapes / .zshrc
Created May 21, 2020 17:30
[Shell Script / Git] git push on new remote branch
### git push new remote branch
### ex. current branch="feature/test"
### git push --set-upstream origin feature/test
alias gpnb='git push --set-upstream origin `git rev-parse --abbrev-ref HEAD`'
@Ancient-Scapes
Ancient-Scapes / .zshrc
Last active May 27, 2020 01:43
[Shell Script / Git]debug remote branch
## debug remote branch
function bd () { git stash save -u "some files when checkout $@ branch" && git fetch && git checkout $@ && git pull && yarn dev }