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
<?php
echo <<<T_WADA
     ,、,,,、,,,
    _,,;' '" '' ;;,,
  (rヽ,;''""''゛゛;,ノr)    
   ,; i ___ 、___iヽ゛;,  テスト書いてないとかお前それ@t_wadaの前でも同じ事言えんの?
  ,;'''|ヽ・〉〈・ノ |゙ ';,
  ,;''"|   ▼   |゙゛';,
  ,;'' ヽ _人_ / ,;'_
@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 / 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";
}
@Leko
Leko / dining-philosophers.js
Created February 28, 2018 17:17
The dining philosophers implementation of Node.js
/**
* The dining philosophers implementation of Node.js
*
* See also:
* http://rust-lang-ja.github.io/the-rust-programming-language-ja/1.6/book/dining-philosophers.html
*
* (c) 2018 Leko
*/
const cluster = require('cluster')
{"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
(function(global, undefined) {
"use strict";
var Pocket = (function() {
var https = require("https");
function Pocket(opt) {
this.consumer_key = opt.consumer_key;
this.access_token = opt.access_token;
}
$ ./wait-for-url.sh localhost:12345
@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
@Leko
Leko / fuel-generate-rest.md
Last active April 7, 2019 08:48
FuelPHPのRestコントローラをgenerateするタスクを作りました

Rest task

概要

FuelPHPでRestコントローラ(WebAPI)を作成するタスクを作成しました。

インストール

  1. ↓のrest.phpをfuel/app/tasks/の中に置く
  2. タスクを実行するコマンド(php oil r rest [name])を叩く

オプション