Skip to content

Instantly share code, notes, and snippets.

@Yuiki
Yuiki / analysis_options.yaml
Created Mar 2, 2020
analysis_options for Flutter
View analysis_options.yaml
# based on https://github.com/flutter/flutter/blob/master/analysis_options.yaml
analyzer:
strong-mode:
implicit-dynamic: false
errors:
missing_required_param: warning
missing_return: warning
todo: ignore
sdk_version_async_exported_from_core: ignore
View .vimrc
set clipboard&
set smartindent
set shiftwidth=2
set tabstop=2
set expandtab
syntax on
View weblio.py
import requests
from bs4 import BeautifulSoup
while True:
word = input()
url = "http://ejje.weblio.jp/content/" + word
request = requests.get(url)
soup = BeautifulSoup(request.text, "html.parser")
meaning = soup.find(class_='content-explanation').text
print(meaning)
View backup.sh
#!/bin/bash
BACKUP_UPPER_LIMIT=5
BASE_DIR=/mnt/backup/backup
NEW_DIR=`date +'%Y%m%d'`
LATEST_DIR=`ssh raspi ls -t $BASE_DIR | head -1`
if [ "$LATEST_DIR" = "$NEW_DIR" ]; then
echo 1#exit 1
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am yuiki on github.
  • I am yuiki (https://keybase.io/yuiki) on keybase.
  • I have a public key ASBcalVwx7aMThT5Pk3UhLEd1B9_23pe5DrLPDDU0mB_ago

To claim this, I am signing this object:

@Yuiki
Yuiki / core.py
Created Aug 26, 2018
Play YouTube on Chrome Cast
View core.py
import pychromecast
from pychromecast.controllers.youtube import YouTubeController
CAST_NAME = ""
VIDEO_ID = ""
chromecasts = pychromecast.get_chromecasts()
cast = next(cc for cc in chromecasts if cc.device.friendly_name == CAST_NAME)
cast.wait()
@Yuiki
Yuiki / gpa2.py
Last active Mar 3, 2018
授業料免除用成績平均値算出 https://gist.github.com/Yuiki/d2394e18a424f17f26b3124a3f4ff8ba の改変なのでGPAと表記していますがあしからず
View gpa2.py
import csv
import sys
argv = sys.argv
if (len(argv) != 2):
print("Usage: python3 {} gpa.csv".format(argv[0]))
quit()
total_amount = 0
@Yuiki
Yuiki / gpa.py
Last active Mar 3, 2018
筑波大のGPA計算
View gpa.py
import csv
import sys
argv = sys.argv
if (len(argv) != 2):
print("Usage: python3 {} gpa.csv".format(argv[0]))
quit()
total_amount = 0
@Yuiki
Yuiki / twiacc.sh
Created Nov 19, 2017
空きアカウントを探す
View twiacc.sh
#!/bin/bash
for i in {a..z}
do
for j in {a..z}
do
command="curl -I https://twitter.com/yuiki${i}${j} -o /dev/null -w '%{http_code}\n' -s"
code=$(eval $command)
if [ $code = "404" ]; then
echo yuiki${i}${j}
@Yuiki
Yuiki / tweet.py
Created Oct 23, 2017
#コンテンツ応用論2017 で30ツイートつぶやくやつ
View tweet.py
import tweepy
from datetime import datetime, timezone
# ここらへん入れてね
auth = tweepy.OAuthHandler('', '')
auth.set_access_token('', '')
api = tweepy.API(auth)
tag = '#コンテンツ応用論2017'
You can’t perform that action at this time.