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.assertj.core.api.exception.RuntimeIOException; | |
import org.springframework.beans.factory.config.BeanDefinition; | |
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; | |
import org.springframework.core.type.filter.RegexPatternTypeFilter; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import java.io.File; | |
import java.io.IOException; | |
import java.lang.reflect.Method; |
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
/** | |
* 内部でUrlFetchAppを使っています | |
*/ | |
class ChatWorkClient { | |
constructor(token) { | |
this.token = token; | |
this.baseUrl = 'https://api.chatwork.com/v2'; | |
this.header = { 'X-ChatWorkToken' : token }; | |
} | |
postMessage(roomId, message) { |
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
class LocalFileJsonRepository { | |
constructor(fileHandle = null) { | |
this.fileHandle = fileHandle; | |
} | |
async init() { | |
if(this.fileHandle) { | |
return; | |
} | |
[this.fileHandle] = await window.showOpenFilePicker(); | |
} |
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
class JsonTable { | |
constructor(data = {}, isSafetyMode = true) { | |
this.data = data; | |
this.isSafetyMode = isSafetyMode; | |
} | |
insert(id, obj) { | |
if(this.data[id]) { | |
throw new Error(`IDがすでに存在する: ${id}`); | |
} | |
this.data[id] = this.copyIfNeeded(obj) |
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
(function() { | |
const obj = { | |
title: document.querySelector("h1.eventDetail-heading").innerText, | |
date: document.querySelector("time.eventAside-day").innerText, | |
time: document.querySelector("div.eventAside-time").innerText.split("\n").join(""), | |
link: location.href | |
} | |
const text = `${obj.title}\n${obj.date}${obj.time}\n${obj.link}`; | |
console.log(text); | |
prompt("リンク", text); |
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
/* | |
Javaのファイルを漁ってクラス構成を分析する | |
--- | |
# 実行環境 node.js | |
古いバージョンでも動くようにする。モダンな書き方はアロー式を使う程度にする | |
# 使い方 | |
- ROOT_PATHを決める | |
- node analizeJava.js |
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
/** | |
* | |
* @param {string} markdownText | |
* @param {Date} now | |
*/ | |
function insertTodaysTitle(markdownText, now) { | |
markdownText = markdownText.trim(); | |
const firstLine = markdownText.split("\n")[0].trim(); | |
const zerofill2 = (num) => ("0" + num).slice(-2); |
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> | |
<meta charset="utf-8" /> | |
<!-- tinytestをGitHub Pagesにホスト --> | |
<script src="https://naosim.github.io/jstinytest/tinytest.js"></script> | |
<h1>test</h1> | |
<script> | |
// product code | |
function add(a, b) { |
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
/** | |
* @param {string} text | |
* @param { {server: string, token: string} } options options.serverはたとえば"misskey.io" | |
*/ | |
function postToMisskey(text, options) { | |
return UrlFetchApp.fetch( | |
`https://${options.server}/api/notes/create`, | |
{ | |
'method': 'POST', | |
'headers' : {'Content-Type': 'application/json'}, |
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
function tableToMarkdown(table) { | |
var lines = [ | |
['カラム名', '型', 'PK', 'UNIQUE', 'NOT NULL', '備考'], | |
]; | |
lines.push(new Array(lines[0].length).fill('---')); | |
// if(table.tableNameComment.length > 0) { | |
// lines = [table.tableNameComment, ...lines]; | |
// } | |
table.columns | |
.map(v => [v.columnName, v.type, v.isPk ? '◯' : '', v.isUnique ? '◯' : '', v.isNotNull ? '◯' : '', v.comment]) |