Skip to content

Instantly share code, notes, and snippets.

View hashrock's full-sized avatar
🍋
Need a lemon?

hashrock hashrock

🍋
Need a lemon?
View GitHub Profile
@hashrock
hashrock / diag.md
Last active February 26, 2024 05:51
作図系ツール・ライブラリまとめ

シーケンス図とかフローチャートをしごとで描画することになった場合、 テキストから生成できたら楽なので、それ系のツールまとめ

GraphViz

http://www.graphviz.org/

  • C製
  • Doxygen, Moinmoinなどと連携可能
  • ブロック図、クラス図、ネットワーク図など
@hashrock
hashrock / svg-drag.js
Last active January 31, 2024 13:22
SVG Drag and Drop with React Hooks
import React from "react";
import ReactDOM from "react-dom";
const Circle = () => {
const [position, setPosition] = React.useState({
x: 100,
y: 100,
active: false,
offset: { }
});
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>SVG Sandbox</title>
<style>
body {
@hashrock
hashrock / vuejs.md
Last active October 5, 2023 23:42
Vue.js資料まとめ(古いので注意)

#まず見るべき

以下のURLは、常に更新されているコンテンツです。

@hashrock
hashrock / npmbenri.md
Last active August 20, 2023 05:54
npmで入る便利ツールまとめ

npm -gでインストールしたり、npm scripts内から使えそうなツールのまとめ

nodeプロセスマネージャ

開発時にリスタートしてくれる用途のものも含む

  • pm2
  • forever
  • node-dev
  • nodemon
@hashrock
hashrock / pack-to-ymd-dir.ts
Created November 26, 2022 11:07
Deno pack file to yyyyMMdd - dir
import {format} from "https://deno.land/std@0.166.0/datetime/mod.ts";
import {basename, dirname} from "https://deno.land/std@0.166.0/path/mod.ts";
const args = Deno.args;
if (args.length === 0) {
console.log("No arguments provided");
Deno.exit(1);
}
@hashrock
hashrock / twtxt-hash.test.ts
Created November 11, 2022 14:30
Deno twtxt hash calc
import { encode } from "https://deno.land/std@0.163.0/encoding/base32.ts";
import { blake2b } from "https://esm.sh/blakejs@1.2.1";
import { DateTime } from "https://esm.sh/luxon@3.1.0";
import { assertEquals } from "https://deno.land/std@0.163.0/testing/asserts.ts";
function base32(payload: Uint8Array) {
return encode(payload).replace(/=/g, "").toLowerCase();
}
function blake2b256(payload: string) {
return blake2b(payload, undefined, 32);
@hashrock
hashrock / npm-scripts.md
Last active February 25, 2022 23:44
awesome-npm-scripts
{
    "build-js": "browserify browser/main.js | uglifyjs -mc > static/bundle.js",
    "build-css": "cat static/pages/*.css tabs/*/*.css",
    "build": "npm run build-js && npm run build-css",
    "watch-js": "watchify browser/main.js -o static/bundle.js -dv",
    "watch-css": "catw static/pages/*.css tabs/*/*.css -o static/bundle.css -v",
    "watch": "npm run watch-js & npm run watch-css",
@hashrock
hashrock / anydown.md
Last active March 27, 2021 13:27
markdown風の文字列からカンバンやガントチャートを生成するための仕様集(草案)

markdown風の文字列からカンバンやガントチャートを生成するための仕様集(草案)

利点

  • DBに格納するより、単純にテキストにしたほうがポータビリティがある
  • その辺の独自操作の多いガントチャートエディタより、一括置換やコピペのできる普通のテキストエディタの方がよさそう
  • markdown中にcodeとして埋め込んでレンダリング&印刷とかやりたい
  • いざとなれば客にはメールでテキストのまま送れる

基本仕様

@hashrock
hashrock / MainTest.java
Created October 2, 2020 10:05
AssertJ-Swing wait example
package hashrock.study.swing;
import org.assertj.swing.core.GenericTypeMatcher;
import org.assertj.swing.edt.GuiActionRunner;
import org.assertj.swing.fixture.FrameFixture;
import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase;
import org.assertj.swing.timing.Condition;
import org.junit.Test;
import static org.assertj.swing.timing.Pause.pause;
import static org.assertj.swing.timing.Timeout.timeout;