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
(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
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
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
/** | |
* 内部で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
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
import * as board2d from 'https://raw.githubusercontent.com/naosim/deno-board2d/v1.2.0/src/mod.ts'; | |
export { | |
Board, | |
BoardMutable, | |
Pos, | |
Direction, | |
X, | |
Y | |
} from 'https://raw.githubusercontent.com/naosim/deno-board2d/v1.2.0/src/mod.ts'; |
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" /> | |
<script> | |
/** | |
* 1次元オセロの盤面に白の石を置く | |
* | |
* - 盤は配列で表現する | |
* - 白の石は'白' | |
* - 黒の石は'黒' | |
* - 空の場所はnull |
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> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/frappe-gantt/0.3.0/frappe-gantt.min.css"></link> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.5.1/snap.svg-min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/frappe-gantt/0.3.0/frappe-gantt.min.js"></script> | |
<svg id="gantt"></svg> | |
<script> |
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
/** | |
* スプレッドシートの2次元配列をエンティティの配列に変換する | |
* - 2次元配列は0番目はヘッダー(カラム名の配列)行、1番目以降にデータが並んでいること | |
* - ヘッダー行のカラム名は空でないこと | |
* - カラム名は値の最初の行だけ採用される 例: "身長\n[cm]" → カラム名は"身長"になる | |
* @param {[['name', 'age'], ['mike', 30]]} ary2d - スプレッドシートのような2次元配列 | |
* @return 例: [{name:"mike", age:30}, {name:"jiro", age:40}] | |
*/ | |
function toEntities(ary2d) { | |
var headers = ary2d[0] |