Skip to content

Instantly share code, notes, and snippets.

View YumNumm's full-sized avatar
:bowtie:

Ryotaro Onoue YumNumm

:bowtie:
View GitHub Profile
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
都議会議員選挙2021の議席状況を取得して、円グラフを描画する
Seleniumで強引に取ってきてるので、時間がかかる。
TODO: BeautifulSoupでスクレイピングしてみる
ちなみに、東京議会選挙は英語で"Tokyo Metropolitan Assembly Election"らしい。
"""
@YumNumm
YumNumm / main.py
Last active December 24, 2021 10:57
iOSのユーザ辞書ファイル(/var/mobile/Library/KeyboardServices/TextReplacements.db)を解析し、Android(GBoard)にインポート可能なzipファイルを作成する
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
* 説明  : iOSのユーザ辞書ファイル(/var/mobile//Library/.../TextReplacements.db)を解析し、Android(GBoard)にインポート可能なzipファイルを作成する
* 作成日 : 2021/08/14
* 作成者 : @YumNumm
* LICNSE : MIT
"""
@YumNumm
YumNumm / fish.sh
Last active November 19, 2021 08:57
Server Setup Script(RPI)
#!/usr/bin/fish
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
fisher install oh-my-fish/theme-bobthefish
echo "Update"
sudo apt-get update > /dev/null
echo "install"
sudo apt-get install fzf -y > /dev/null
fisher install jethrokuan/fzf
@YumNumm
YumNumm / light_controller.dart
Last active January 30, 2022 16:18
部屋のライトコントローラ(NECだったかな)
import 'dart:io';
final Map<String, String> light_map = {
"on":
"0x01,0x58,0x00,0xab,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x42,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x17,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x17,0x00,0x16,0x00,0x42,0x00,0x15,0x00,0x42,0x00,0x16,0x00,0x16,0x00,0x16,0x00,0x42,0x00,0x15,0x00,0x42,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x42,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x16,0x00,0x16,0x00,0x42,0x00,0x15,0x00,0x17,0x00,0x16,0x00,0x42,0x00,0x15,0x00,0x17,0x00,0x16,0x00,0x41,0x00,0x16,0x00,0x17,0x00,0x16,0x06,0x1c",
"off":
"0x01,0x58,0x00,0xab,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x42,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x17,0x00,0x16,0x00,0x17,0x00,0x16,0x00,0x17,0x00,0x15,0x00,0x17,0x00,0x16,0x00,0x42,0x00,0x15,0x00,0x42,0x00,0x16,0x00,0x16,0x00,0x16,0x00,0x42,0x00,0x15,0x
@YumNumm
YumNumm / main.py
Last active February 20, 2022 22:31
強震モニター ExtensionからPOSTを受け取ってツイート/FCM POSTするプログラム
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import parse_qs, urlparse
import firebase_admin
from firebase_admin import credentials
from firebase_admin import auth
from firebase_admin import messaging
import tweepy
import time
import reader
import 'package:html/parser.dart' show parse;
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart';
Future<void> main(List<String> args) async {
const String url = "https://typhoon.yahoo.co.jp/weather/jp/earthquake/list/";
final target = Uri.parse(url);
final res = await http.get(target);
if (res.statusCode != 200) {
@YumNumm
YumNumm / weather.rb
Last active August 12, 2022 07:22
雲の形に見えない....
eval(s=(%w(require
'uri';require'net/http';requi
re"json";n='';firstM="東京の明日の天 気は";;e
ndM="です!";;res=JSON.parse(Net::HTT P.get_respo
nse(URI('https://www.jma.go.jp/bosai/forecast/data/for
ecast/010000.json')).body)[8]["srf"]["timeSeries"][0]["are
as"]["weathers"][0];;if(res.include?"晴")then;;res="\e[44;97m"+
res+"☀️"+"\e[m";;elsif(res.include?"曇")then;;res="\e[44;97m"+res+"
☁"+"\e[m";;elsif(res.include?"雨")then;;res="\e[44;97m#{firstM
}#{res}"+"☔"+"#{endM}\e[ m";;;end;puts("n='#{res}'\n"
import requests
import os
import datetime
def pga(now) -> str:
u1 = now.strftime('%Y%m%d')
u2 = now.strftime('%Y%m%d%H%M%S')
return "http://www.kmoni.bosai.go.jp/data/map_img/RealTimeImg/acmap_s/"+ str(u1) +"/" + str(u2) + ".acmap_s.gif"
def shindo(now) -> str:
@YumNumm
YumNumm / dart.json.code-snippets
Created May 12, 2023 16:09
FreezedとJsonEnumのVSCode code-snippets
{
"Freezed class with import": {
"prefix": "frzclass",
"description": "Create a Freezed class",
"body": [
"import 'package:freezed_annotation/freezed_annotation.dart';",
"part '${TM_FILENAME_BASE}.freezed.dart';",
"part '${TM_FILENAME_BASE}.g.dart';",
"",
"@freezed",
@YumNumm
YumNumm / README.md
Last active July 11, 2023 16:26
BMIを算出するFlutter Application