Skip to content

Instantly share code, notes, and snippets.

View kat0h's full-sized avatar
:octocat:

Kota Kato kat0h

:octocat:
  • UEC
View GitHub Profile
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg1"
xml:space="preserve"
@kat0h
kat0h / file.rb
Last active November 20, 2023 15:51
Image Quine
eval$s="require('zlib');FONT=Zlib::Inflate.inflate('eJwlUbFu2zAUf
JIJlI2Nmik8aBAKikBqwUvcrUMgSAoQNJmS9gfcregXBJ1oWkAtuUBhZ2mWwNCQwh
469AMCZvOQL+ikDgU6Fv2CHlUOhyN57949UpNbXBqSNLhIwQdvfiUXKf/wce+PHu9
y8WUSrIrRch1ETskiJmQqZMawVV9Hkkh+nsvWZZwT9XVL6a0mngtNYfX+e2n5xPDI
hvOIHzeJmPqlZS9OE5EmM2tK28v7qrQJ9Bn0Q3Cg2dcwCSbOCq1ZxNGXOk1CBFJE5
NxIh/Pn3+D/Or6r5FF1qBao5bK0L1dxfaUT05ezxqGBc7cuG1Ud1pUMpcvzRGRsqd
XqU7ySOIBS/djiVi1Gt9BUcV1aeLa18Xa5BofymXnkd23iCrRqNQ7PwUfbTarKfAC
H6gC3bqJZE2ZMZJamPuMUouM+0v5/L8I4bigsz96UjTQP9cKSt0N+//EGacHvprZ3
iqTQ/K4vh05TSe65/Izu2dMTac7GdRq0E1HnbFtJ8p0GtchGnV39l5O3uX0ntf+wN
vDZhV0rjgvxypIf19drh+caiPzkH7h4OLkcUucn/quXcZFa3s4biLTAv3h7BTL/A5
@kat0h
kat0h / index.html
Created December 14, 2022 14:33
BMI計算 HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
<!-- 入力 -->
<label for="sincho">身長 (50-200 cm):</label>
<input type="number" id="sincho" min="50" max="200">
<br>
@kat0h
kat0h / a.js
Created September 24, 2022 13:52
a
const array1=[1,2,3,4,5,6]
const array2=array1.a||(z=>(F=>l=>z(X=>m=>m[1].length==0?[F(m[0]),[]]:[F(m[0]),X(m[1])])(l))(i=>i%2?[i,i,i]:[i,i])(z(a=>l=>l.length==1?[l[0],[]]:[l[0],a(l.slice(1))])(array1)))(A=>(B=>A(c=>B(B)(c)))(B=>A(c=>B(B)(c)))).flat(1/0)
console.log(array2)
@kat0h
kat0h / AnalogClockQuine.rb
Last active September 4, 2022 05:44
プログラム
# アナログ時計の形に整形された 自分自身と等しいプログラムを出力するプログラム
eval$s=%w'a=Array;s=
34;b=a.new(s){a.new(s,0)};(0..
.s).each{|x|(0...s).each{|y|xx=x-s/2.1
;yy=y-s/2.1;i=xx**2+yy**2;b[y][x]=(s/2.8)*
*2<i&&i<(s/2)**2?1:((i<(s/20)**2)?1:0)}};l=Math;
t=Time.new;h,m=( t.hour%12+t.min*
0.00872664625) *0.5235,t.min*
0.1047;c=->(p, z,u,d,e){g=d
-z;i=(g>=0)? 1:-1;o=e-u;j
@kat0h
kat0h / counter.vim
Last active August 29, 2022 11:47
Vimのバッファでカウンターを実装するサンプル
function! s:State(bufid) abort
let l:counter = 0
let l:bufid = a:bufid
function! Inc() closure
let l:counter += 1
call Flash()
endfunction
function! Dec() closure
@kat0h
kat0h / zundoko.md
Last active August 3, 2022 13:00
ズンドコキヨシ
const Z = (f=> (x=>f(y=>x(x)(y))) (x=>f(y=>x(x)(y))) )

console.log(
  Z(
    (x) => (
      (n) => (
        (n==0) ? 1 : n * x(n-1)
      )
    )
@kat0h
kat0h / VimBug?.md
Created July 31, 2022 14:47
Vimのバグ!
let Ref = function({val -> execute("echo val")})
call Ref("hoge") " => hoge
vim9script
var Ref = function((val) => execute("echo val"))
Ref("hoge") # =&gt; E121: Undefined variable: val
@kat0h
kat0h / has_wsl.patch
Last active May 22, 2022 09:13
has('wsl') porting for vim (供養)
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 72e2cf13f..833a39a11 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -10445,6 +10445,7 @@ xpm Compiled with pixmap support.
xpm_w32 Compiled with pixmap support for Win32. (Only for
backward compatibility. Use "xpm" instead.)
xsmp Compiled with X session management support.
+wsl Vim is running on WSL (Windows Subsystem for Linux).
xsmp_interact Compiled with interactive X session management support.
#反転
eval(s="a='eval(s='+s.inspect+')';puts a.reverse")
#色付き
eval(s='a="\\e[31meval(s="+s.inspect+")\\e[m";puts a')