パターンマッチングを使いたくなって 夜しか眠れなくなってしまったので 遊びがてら書いてみました
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
""" | |
都議会議員選挙2021の議席状況を取得して、円グラフを描画する | |
Seleniumで強引に取ってきてるので、時間がかかる。 | |
TODO: BeautifulSoupでスクレイピングしてみる | |
ちなみに、東京議会選挙は英語で"Tokyo Metropolitan Assembly Election"らしい。 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
""" | |
* 説明 : iOSのユーザ辞書ファイル(/var/mobile//Library/.../TextReplacements.db)を解析し、Android(GBoard)にインポート可能なzipファイルを作成する | |
* 作成日 : 2021/08/14 | |
* 作成者 : @YumNumm | |
* LICNSE : MIT | |
""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"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", |
OlderNewer