Skip to content

Instantly share code, notes, and snippets.

View minodisk's full-sized avatar

Daisuke Mino minodisk

  • Knowledge Work
  • Tokyo, Japan
  • 14:33 (UTC +09:00)
  • X @minodisk
View GitHub Profile
@minodisk
minodisk / parser.ts
Created October 19, 2022 13:43
Adds row and column information to tokens created using the tokenizer for BigQuery implemented in sql-formatter.
import { formatters } from "sql-formatter";
import type { Token as OrigToken } from "sql-formatter/lib/src/lexer/token";
export type Token = OrigToken & {
line: number;
column: number;
};
export const createParser = () => {
const tokenizer = formatters.bigquery.prototype.tokenizer();
import { generate } from "ts-to-zod";
import clipboard from "clipboardy";
(async () => {
const sourceText = await clipboard.read();
const schema = generate({
sourceText,
})
.getZodSchemasFile()
.replace("// Generated by ts-to-zod\n", "");
@minodisk
minodisk / config.h
Created February 12, 2022 16:19
crkbdのLEDレイアウト
#undef RGBLED_NUM
#define RGBLED_NUM 54
#undef RGBLED_SPLIT
#define RGBLED_SPLIT {27, 27}
#define LED_LAYOUT( \
L00, L01, L02, R00, R01, R02, \
L03, L04, L05, R03, R04, R05, \
\
L06, L07, L08, L09, L10, L11, R06, R07, R08, R09, R10, R11, \
with
items as (
select 1 as id, ['dog'] as tags
union all select 2 as id, ['cat'] as tags
union all select 3 as id, ['bird'] as tags
union all select 4 as id, ['dog', 'cat'] as tags
union all select 5 as id, ['cat', 'bird'] as tags
union all select 6 as id, ['bird', 'dog'] as tags
union all select 7 as id, ['dog', 'cat', 'bird'] as tags
)
@minodisk
minodisk / example.js
Created December 22, 2017 14:48
Usage of @minodisk/medkit
import Client from "@minodisk/medkit";
(async () => {
const client = new Client();
const postId = await client.createPost(
"<h3>Title</h3><h4>Subtitle</h4><p>Text</p>",
);
const html = await client.readPost(postId); // -> "<h1>Title</h1><h2>Subtitle</h2><p>Text</p>" or "<h3>Title</h3><h4>Subtitle</h4><p>Text</p>"
await client.updatePost(
postId,
#/bin/bash
images=$(gcloud beta container images list --format 'value(name)')
for i in $images; do
tags=$(gcloud beta container images list-tags $i --format 'value(tags)')
for t in $tags; do
echo delete $i:$t
gcloud beta container images delete $i:$t --resolve-tag-to-digest --quiet
done
@minodisk
minodisk / コーヒー豆.md
Last active August 28, 2017 05:06
リピート購入するためのコーヒー豆のメモ

エチオピア シャキッソ タデ農園 G-1

モカフレーバー。口に含むと栗のような香り。後味が柑橘系の酸味。

  • 苦味: 2
  • 酸味: 2
  • 甘み: 4
  • コク: 5
  • 香り: 3
  • 重さ: 2

a b c d e

abc -_.!*'()<>#"%{}|^[]`;/?:@&=+$,

abc .!*'()<>#"%{}|^[]`;/?:@&=+$,

ab()<>#"%{}|^[]`;/?:@&=+$,c

ab%c

@minodisk
minodisk / main.go
Created April 4, 2015 03:13
Pipe io.Reader in Go
package main
func main() {}
@minodisk
minodisk / dl-anitube.js
Created March 16, 2015 15:46
Anitubeの.mp4を別Windowで開く
jwPlayer.config.sources.forEach(function(source){if(source.default){window.open(source.file);return false}})