Skip to content

Instantly share code, notes, and snippets.

View keichan34's full-sized avatar
šŸ‘‹
Hello!

Keitaroh Kobayashi keichan34

šŸ‘‹
Hello!
View GitHub Profile
@keichan34
keichan34 / index.ts
Created January 26, 2024 01:11
ę”æä»¤ęŒ‡å®šéƒ½åø‚ć®č‡Ŗę²»ä½“ć‚³ćƒ¼ćƒ‰
// ę”æä»¤ęŒ‡å®šéƒ½åø‚ (å…ƒćƒ‡ćƒ¼ć‚æć§ćÆč”Œę”æåŒŗć«ćŖć£ć¦ć„ć‚‹ćŒć€ē§é”ćÆåŒŗåŸŸå…Øä½“ć§ć¾ćØć‚ćŸć„ļ¼ˆę±äŗ¬23ē‰¹åˆ„åŒŗä»„å¤–ļ¼‰)
// ć“ć®é…åˆ—ćÆć€č”Œä¾‹ęŒ‡å®šéƒ½åø‚ć®å…¬å…±å›£ä½“ć‚³ćƒ¼ćƒ‰ć®é ­3または4攁を含む
const DESIGNATED_CITIES = [
/^011/, // åŒ—ęµ·é“ęœ­å¹Œåø‚
/^041/, // å®®åŸŽēœŒä»™å°åø‚
/^111/, // åŸ¼ēŽ‰ēœŒć•ć„ćŸć¾åø‚
/^121/, // åƒč‘‰ēœŒåƒč‘‰åø‚
/^141(?!3|5)/, // ē„žå„ˆå·ēœŒęØŖęµœåø‚
/^1413/, // ē„žå„ˆå·ēœŒå·å“Žåø‚
/^1415/, // ē„žå„ˆå·ēœŒē›øęØ”åŽŸåø‚
@keichan34
keichan34 / build.sh
Last active March 13, 2023 06:46
ShapefilećŒå…„ć£ćŸćƒ‡ć‚£ćƒ¬ć‚ÆćƒˆćƒŖć‚’äø€ę‹¬ć§äø€ć¤ć®mbtilesć«ć‚¢ćƒ¼ć‚«ć‚¤ćƒ–ć™ć‚‹
#!/bin/bash -e
input=${1}
outdir=$(mktemp -d)
echo "Output: $outdir"
for shp in $(find "$input" -name '*.shp'); do
name=$(basename "$shp" .shp)
out_geojson="${outdir}/${name}.ndgeojson"
@keichan34
keichan34 / README.md
Created January 31, 2023 02:22
åœ°å›³ć‚æć‚¤ćƒ«ćØćć®ć‚æć‚¤ćƒ«ć®å­å­«ć‚’

tile_children

ć‚ć‚‹ć‚æć‚¤ćƒ«ć®å­å­«ć®äø€č¦§ć‚’å–å¾—ć™ć‚‹

USAGE

chmod +x tile_children.py
./tile_children.py [parent tile] [maxzoom] [suffix]
@keichan34
keichan34 / README.md
Last active February 10, 2023 07:47
ę³•å‹™ēœćƒ‡ćƒ¼ć‚æć‚‚ć‚ć‚‚ć‚
cp -r moj_data/ ./
mkdir all_zips
find . -name '*.zip' -maxdepth 1 | xargs -P 16 -I '{}' unzip '{}' -d ./all_zips

恓恓恧 all_zips ć«å±•é–‹ć•ć‚ŒćŸzip恌恂悋 ę¬”ćÆä»»ę„åŗ§ęØ™ćØå…¬å…±åŗ§ęØ™ē³»ć‚’åˆ†ć‘ć‚‹

@keichan34
keichan34 / App.tsx
Created April 27, 2021 08:08
normalize-japanese-addresses ć®ć‚µćƒ³ćƒ—ćƒ« React App
import React, { useCallback, useState } from 'react'
import { normalize, NormalizeResult } from '@geolonia/normalize-japanese-addresses'
interface Result {
input: string
normalized: NormalizeResult
}
const App: React.FC = () => {
const [ result, setResult ] = useState<Result | undefined>(undefined)
@keichan34
keichan34 / NewWindowPortal.tsx
Created September 11, 2020 02:03
Open a new window with a React portal
import React, { useEffect, useMemo, useRef } from "react"
import { createPortal } from "react-dom"
const NewWindowPortal: React.FC = ({children}) => {
const containerEl = useMemo(() => document.createElement("div"), [])
useEffect(() => {
if (!containerEl) {
return
}
@keichan34
keichan34 / config.fish
Created April 17, 2020 01:24
My Fish-shell config
function fish_greeting
echo "! COMPUTER_NAME"
end
set -x EDITOR vim
set -x LESS -asrRix8
set -x LANG en_US.UTF-8
set -x LC_ALL en_US.UTF-8
set -x LANGUAGE en_US.UTF-8
@keichan34
keichan34 / package.json
Created July 23, 2018 11:56
hacking CRA to work with babel-plugin-relay
{
"scripts": {
"build": "node ./setup && react-scripts build"
}
}
@keichan34
keichan34 / blurb.fish
Last active March 12, 2017 01:19 — forked from jeremy-w/blurb.fish
Fish function to create or reply to a social post on 10 Centuries. MPLv2
function blurb --description Post\ to\ 10C.\\nblurb\ post\ MESSAGE\\nblurb\ POST_ID\ REPLY --argument reply_id message
set -l token $TEN_CENTURIES_API_TOKEN
set -l endpoint https://api.10centuries.org/content/write
set -l usage 'blurb: post or reply to a message on 10C
Usage:
blurb post MESSAGE
Post a new blurb

Keybase proof

I hereby claim:

  • I am keichan34 on github.
  • I am sleepy_keita (https://keybase.io/sleepy_keita) on keybase.
  • I have a public key ASASuKTnKfWXIiwyRu4jyTDn-i8LUj1qZLrKHeNPRBtlsAo

To claim this, I am signing this object: