Skip to content

Instantly share code, notes, and snippets.

View m77so's full-sized avatar
🐱
よろしくおねがいします

m77so m77so

🐱
よろしくおねがいします
  • Tokyo, Japan
View GitHub Profile
@m77so
m77so / sunrise.js
Created June 5, 2018 15:31
// 2011年作成
//祝日判定関数
dayl = new array(7);
dayl=[["日",2],["月",0],["火",0],["水",0],["木",0],["金",0],["土",1]];
function holcl(y2,m2,d2,dx2){
if(m2 == 1 && d2 == 1){return ["元旦",2];}
else if(m2 == 2 && d2 ==11){return ["建国記念日",2];}
else if(m2 == 4 && d2 == 29){return ["昭和の日",2];}
else if(m2 == 5 && d2 == 3){return ["憲法記念日",2];}
else if(m2 == 5 && d2 == 5){return ["こどもの日",2];}
else if(m2 == 11 && d2 == 3){return ["文化の日",2];}
@m77so
m77so / readme.txt
Created July 12, 2018 15:01
Twitter全履歴データダウンロードするやつのれあどめ
INTRODUCTION
============
This archive consists of machine-readable JSON files containing information associated with your account. We’ve included the information we believe is most relevant and useful to you, including your profile information, your Tweets, your DMs, your Moments, your media (images, videos and GIFs you’ve attached to Tweets, DMs, or Moments), a list of your followers, a list of accounts following you, your address book, Lists that you’ve created, are a member of, or are subscribed to, interest and demographic information that we have inferred about you, information about ads that you’ve seen or engaged with on Twitter, and more.
The information contained in this archive reflects the state of the account at the time when the archive was created. In addition, if we do not have any data associated with your account for a particular category (e.g., if you have never created a List), then this archive will not include a file for that category.
CONTENTS
========
This archive contains:
import { OutputJSON } from './dataInterface'
const fs = require('fs')
const iconv = require('iconv-lite')
const path = require('path')
if (process.argv.length - 2 !== 3) {
console.warn('The number of arguments is less or much.\n\nnode marsToTSV.js mars_sd.dat mars_nn.dat outputDir')
process.exit(100)
}
const marsSdDat = process.argv[2]
気象庁 http://www.jma.go.jp/jp/typh/
24時間予報 1日8回 +50~70
72時間予報 1日4回 3,9,15,21 +50~70
5日進路予報 1日4回 3,9,15,21 +90~110
日本列島に大きな影響を及ぼす台風が接近している時
1時間ごとに現在の中心位置
観測時刻の1時間後、さらに24時間先までの3時間刻みの中心位置
暴風域確率表示 http://www.jma.go.jp/jp/typh/typh_prob.html
@m77so
m77so / azik.txt
Created September 15, 2018 08:00
l; ;
x; ;
l: :
x: :
- ー
: ー
la ぁ
a あ
li ぃ
i い
import librosa
import librosa.display
import numpy as np
import matplotlib.pyplot as plt
import scipy
# def librosa.lpc(y, order): return a
def lpc_formant(a, fs):
poles = np.roots(a)
@m77so
m77so / git-file-history.sh
Last active January 29, 2019 07:20
少し使いやすくする Tを除去
#!/bin/bash
TM=$(mktemp -d)
git log --pretty=format:"%cd" --date=format:'%Y/%m/%d %H:%M:%S' $1 > $TM/gittime
git log --pretty=format:"%H" $1 | xargs -n 1 -I {} git ls-tree -r -l {} $1 |awk '{print $4}' > $TM/gitlstree
paste $TM/gittime $TM/gitlstree
@m77so
m77so / get_key_counts.py
Last active June 3, 2024 14:42
Export key type counts from Niz Plum 66. Reference: https://github.com/cho45/niz-tools-ruby/
import hid
import time
h = hid.device()
keyboard_path = [ a['path'] for a in hid.enumerate(0x0483, 0x512A) if a['interface_number']==1][0]
h.open_path(keyboard_path)
# https://github.com/cho45/niz-tools-ruby/blob/71075ee0ef2a1e609dd40c4610b433e7afcf8aa1/niz.rb#L296
HWCODE = {
0 : '', # unmapped value
## wikipedia
https://en.wikipedia.org/wiki/Myanmar_units_of_measurement
長さ、質量、体積が紹介
## fb投稿1
https://www.facebook.com/1884652785111851/photos/a.1884664575110672/1968740863369709/?type=3
この辺りはヤードポンド法の長さ インチ、フィート、ヤード、チェーン、ハロン、マイル
```

ChatGPTと一緒にコードを書きます。本日の題材はこちら!

題材

市外局番の一覧の「番号区画」の文字列を使いやすく変換します。

市町村名を列挙した「北海道恵庭市、千歳市」のようなテキストを扱いやすくします。

結果は、「都道府県、政令指定都市または郡、市区町村」の3要素の配列の配列にしたいです。