This file contains 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
// Copyright (c) Masaya Taniguchi. | |
// This software is licensed under the Public Domain. | |
// | |
// Isabelle overrides the existing keybindings. | |
// This script prevents this behaviour with some properties. | |
// | |
// Usage | |
// $ deno run -A ./override.ts Emacs_keys.props imported_keys.props >> ../properties | |
import { readLines } from "https://deno.land/std@0.192.0/io/mod.ts" |
This file contains 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
// ==UserScript== | |
// @name Show Weekly Diff / esa.io | |
// @namespace io.github.tani | |
// @match https://*.esa.io/posts/* | |
// @grant none | |
// @version 1.0 | |
// @author Masaya Taniguchi | |
// @description 2023/5/11 18:40:31 | |
// @require https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js | |
// ==/UserScript== |
This file contains 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 pandoc from "https://cdn.jsdelivr.net/gh/tani/deno-pandoc/out/mod.js"; | |
import * as MediaType from "https://deno.land/x/media_types@v2.3.7/mod.ts"; | |
import * as Eta from "https://deno.land/x/eta@v1.12.3/mod.ts"; | |
import * as Yaml from "https://deno.land/std@0.114.0/encoding/yaml.ts"; | |
import { serve } from "https://deno.land/std@0.114.0/http/server.ts"; | |
const { pathname: dirname } = new URL('.', import.meta.url) | |
async function handleRequest(request: Request): Promise<Response> { | |
const { pathname } = new URL(request.url) |
This file contains 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
#NoEnv | |
#Warn | |
SendMode Input | |
SetWorkingDir %A_ScriptDir% | |
!c:: | |
Send,^c | |
ClipWait | |
StringReplace,clipboard,clipboard,`r`n, ,All |
This file contains 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
// Fuzzy matching written by TANIGUCHI Masaya | |
// Public Domain | |
function findAllMatches(pattern: string, source:string) { | |
const indicesList: number[][] = pattern.split("").map(char => { | |
return ([] as number[]).concat( | |
...source.split("").map((c, i) => c === char ? [i] : []) | |
) | |
}) | |
function recur(acc: number[], i: number): number[][] { |
This file contains 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
lualatex('-shell-escape -synctex=1 -interaction=nonstopmode -halt-on-error'); | |
$aux_dir = 'build'; | |
$out_dir = 'build'; | |
$makeindex = 'upmemdex'; | |
$bibtex = 'upbibtex'; | |
$biber = 'biber --bblencoding=utf8 -u -U --output_safechars'; | |
sub pdflatex { | |
$pdf_mode = 1; |
This file contains 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
;; | |
;; # SPACK | |
;; | |
;; SPACK is a toy package system for LISP. | |
;; | |
;; ## Syntax | |
;; | |
;; Predefined functions and variables are unprefixed. | |
;; User-defined functions and variables are prefixed by package | |
;; declared by `spack/defpackage'. There is a separator `/' between |
This file contains 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
#lang racket | |
(require srfi/1) | |
(define (walk-bfs-n node) | |
;; ((walk-bfs-n '(a (b c d) e)) list) | |
(lambda (k) | |
(if (list? node) | |
(let* ((label (first node)) | |
(nodes (rest node)) | |
(labels (map (lambda (node) (call/cc (walk-bfs-n node))) nodes))) |
This file contains 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
FROM debian:10 | |
WORKDIR /work | |
ENV LANG=C.UTF-8 | |
# | |
# Install dependencies | |
# | |
RUN apt-get update \ | |
&& apt-get upgrade -y \ |
This file contains 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
// clang++ -std=c++17 -lncurses -o maze maze.cpp | |
#include<array> | |
#include<cstdio> | |
#include<cstdint> | |
#include<ctime> | |
#include<cstdlib> | |
#include<ncurses.h> | |
enum State { |
NewerOlder