Skip to content

Instantly share code, notes, and snippets.

View Leko's full-sized avatar
🏠
Working from home

Shingo Inoue Leko

🏠
Working from home
View GitHub Profile
@Leko
Leko / index.js
Last active January 24, 2022 11:50
Wordle solver Node.js example
#!/usr/bin/env node
const readline = require("node:readline");
async function guess(feedbacks) {
// You can use `console.error` for debugging.
console.error(feedbacks);
// Write your solver!
return "count";
}
{"version":1,"notes":"My awesome keymap","documentation":"\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"crkbd/rev1","keymap":"corone-cherry","layout":"LAYOUT","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_MINS","KC_LCTL","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","MO(2)","KC_LGUI","MO(1)","KC_SPC","KC_ENT","KC_BSPC","KC_LALT"],["KC_GRV","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_LPRN","KC_RPRN","KC_EQL","KC_LCTL","KC_1","KC_2","KC_3","KC_4","KC_5
@Leko
Leko / sushida-ai.js
Last active September 17, 2022 19:07
寿司打(Sushi-da) AI http://typingx0.net/sushida/play.html
// OCRライブラリ突っ込む
const script = document.createElement('script')
script.src =
'https://unpkg.com/tesseract.js@v2.0.0-alpha.16/dist/tesseract.min.js'
script.onload = () => {
// キー入力の模倣をする
function sendKey(key) {
const event = new KeyboardEvent('keypress', { charCode: key.charCodeAt() })
document.dispatchEvent(event)
}
@Leko
Leko / LT.md
Last active October 20, 2019 08:30
#deno_ja LT
@Leko
Leko / 0_tc39_study_Leko.md
Last active October 9, 2019 11:24
#tc39_study - Leko
$ ./wait-for-url.sh localhost:12345
@Leko
Leko / peco_monorepo.sh
Created February 11, 2019 06:29
Search and change directory with peco in monorepo
peco_monorepo() {
local module_paths=($(node -e 'console.log(module.paths.join(" "))'))
local found=0
for module_paths in ${module_paths[@]}
do
local lerna_bin="$module_paths/.bin/lerna"
if [ ! -f $lerna_bin ]; then
continue
fi
@Leko
Leko / index.js
Last active December 29, 2018 17:25
const licenses = require('./licenses.json')
const osiApprovedLicenses = licenses.filter(l => l.keywords.includes('osi-approved'))
@Leko
Leko / README.md
Created November 3, 2018 07:00
DO NOT USE IN PRODUCTION. It can only use for tests.
import assert from './assert'
import { runInTimezone } from './runInTimezone'

const offset = await runInTimezone('Asia/Tokyo', () => new Date().getTimezoneOffset())
assert.strictEquals(offset, -540)
// @flow
import { h, render, Text, Fragment, Component } from "ink";
import Spinner from "ink-spinner";
import chalk from "chalk";
import emoji from "node-emoji";
import { Provider, connect } from "ink-redux";
import { createStore } from "redux";
const Line = ({ text }) => (
<div>