Skip to content

Instantly share code, notes, and snippets.

@deton
deton / PKGBUILD
Last active March 29, 2026 07:48
GNU screen for MSYS2 and git-for-windows
pkgname=screen
pkgver=4.9.1
pkgrel=1
pkgdesc='A terminal multiplexer'
url='https://www.gnu.org/software/screen/'
msys2_repository_url="http://ftp.gnu.org/gnu/screen/"
msys2_references=(
"cpe: cpe:/a:gnu:screen"
)
arch=('i686' 'x86_64')
@deton
deton / PKGBUILD
Last active March 29, 2026 07:45
lynx (for Japanese) for MSYS2 and git-for-windows
_realname=lynx
pkgname=lynx-ja
pkgver=2.9.2
_relver=${pkgver}
pkgrel=1
pkgdesc="A text browser for the World Wide Web (for Japanese)"
url="https://lynx.invisible-island.net/"
msys2_repository_url='https://github.com/ThomasDickey/lynx-snapshots'
msys2_pgp_keys_url="https://invisible-island.net/public/public.html"
msys2_references=(
@deton
deton / form4make_gtfs.html
Created March 15, 2026 07:19
generate inputs for make_gtfs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>form for make_gtfs</title>
<!-- based on https://formio.github.io/formio.js/app/builder.html -->
<!--<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!--<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js"></script>-->
@deton
deton / citycode_bbox.json
Last active March 7, 2026 03:31
市区町村コード(標準地域コード)のエリアに対応する、bounding box
{"01609":[143.06783479,41.92436227,143.32616735,42.19120942],"01371":[139.76611918,42.13507374,140.03830226,42.61673062],"01586":[141.8770384,42.5286075,142.33367297,42.98719934],"01395":[140.56221659,42.70716751,140.80668061,42.87811921],"01337":[140.5750228,41.84636572,140.78745513,42.06284343],"01222":[141.79856945,43.14303484,142.16153386,43.35872562],"01362":[139.99216635,41.57574459,140.35822702,41.85707005],"01633":[143.00864863,43.18755535,143.41205102,43.59531387],"01460":[142.38195998,43.38168878,142.68618834,43.55099767],"01457":[142.68148724,43.52616379,143.17967782,43.95309931],"01425":[141.94468966,43.4091408,142.07247529,43.48504769],"01468":[142.52925623,44.14180212,142.88229193,44.4859215],"01461":[142.34503224,43.35154152,142.56173573,43.47136825],"01471":[141.97558493,44.45980355,142.22239494,44.90526523],"01638":[142.75171203,42.56016906,143.19718552,42.73279707],"01692":[144.57044216,43.46114898,145.11365395,43.70213624],"01513":[142.12629262,44.77810339,142.43090153,45.02457163],"01364":
@deton
deton / 00_tomesh1.sh
Last active March 3, 2026 12:25
市区町村コード(標準地域コード)のエリアに対応する、1次地域メッシュコードのCSV, JSONを作成。1次地域メッシュ単位の国土数値情報のダウンロードのため
#!/bin/sh
# Prepare:
# download csv files from https://www.stat.go.jp/data/mesh/m_itiran.html
# and convert to utf-8
head -1 utf8/01.csv >citycode-mesh1code.csv
for f in utf8/*.csv
do
cat "$f" | awk 'BEGIN{FS=",";OFS=","}NR>1{print $1,$2,substr($3,0,4),$4}' | uniq >>citycode-mesh1code.csv
@deton
deton / count_trips_in_polygon.py
Last active November 9, 2025 12:01
lines intersect polygon
# Count trip entries into a polygon in 10-minute bins.
# (Generated using GitHub Copilot)
import argparse
import json
from datetime import datetime
from shapely.geometry import shape, Point, LineString
import pandas as pd
from typing import NamedTuple, List
from geopy.distance import geodesic
@deton
deton / snap_point_to_osmnx_edge.py
Last active November 2, 2025 03:39
snap points to nearest OSMnx edges.
# snap points to nearest OSMnx edges.
import argparse
import os
import geopandas as gpd
import osmnx as ox
import pandas as pd
parser = argparse.ArgumentParser()
parser.add_argument("point_file", help="point list csv file")
parser.add_argument("-x", "--longitude", help="column name for longitude", default="longitude")
@deton
deton / pointsdistbear.py
Last active October 13, 2025 01:09
出発地点が、時間帯によって、vendor間の違いがあるか、グラフ化して見る。https://colab.research.google.com/drive/1huNXbUTTg57sJf7jLb1Rs00yUR3WHb75?usp=sharing
import marimo
__generated_with = "0.16.5"
app = marimo.App(width="full")
@app.cell
def _(mo):
mo.md(
r"""
@deton
deton / README.md
Last active November 24, 2025 03:20
Polygonから指定距離以内にあるPointのみを抽出。(駅の近くにある駐車場を抽出)
@deton
deton / README.md
Last active October 26, 2025 07:57
make_gtfsを使って仮のGTFS(時刻表)を生成する(神戸電鉄 有馬線の一部)