Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
@Yuiki
Yuiki / analysis_options.yaml
Created March 2, 2020 06:54
analysis_options for Flutter
# 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
set clipboard&
set smartindent
set shiftwidth=2
set tabstop=2
set expandtab
syntax on
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)
#!/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

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 August 26, 2018 12:20
Play YouTube on Chrome Cast
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 March 3, 2018 10:43
授業料免除用成績平均値算出 https://gist.github.com/Yuiki/d2394e18a424f17f26b3124a3f4ff8ba の改変なのでGPAと表記していますがあしからず
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 March 3, 2018 10:39
筑波大のGPA計算
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 November 19, 2017 02:22
空きアカウントを探す
#!/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}