Skip to content

Instantly share code, notes, and snippets.

View ka2n's full-sized avatar

Katsuma Ito ka2n

View GitHub Profile
@ka2n
ka2n / index.js
Created January 20, 2023 02:30
Read streaming response with fetch
const http = require('http')
const express = require('express')
const app = express()
app.get('/', (req, res) => {
res.setHeader('Content-Type', 'text/html')
res.setHeader('Transfer-Encoding', 'chunked');
res.send(`<html><body><h1>Hello World</h1>
<ul id="list"></ul>
<script>
@ka2n
ka2n / main.go
Created March 9, 2023 20:50
echo server
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
@ka2n
ka2n / convert
Created July 8, 2024 01:28
convert no warn shim
#!/bin/env bash
exec -a "magic" magick convert "$@"
@ka2n
ka2n / gen-ast-grep-manifest.ts
Created August 20, 2024 05:52
remove pathpida 50%
import {pagesPath} from './lib/$path.ts'
type Rule = {
pattern: string
fix: string
id: string
}
const rulesForLevel = (paths: any, parent: string[] = []) => {
let rules: Rule[] = []