This file contains hidden or 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
| #気象警報・注意報 : 福岡県 取得 | |
| s = `curl "http://www.jma.go.jp/jp/warn/346_table.html"` | |
| File.open("dummy.html", "w") do |f| | |
| f.puts(s) | |
| end | |
| s = `xmllint --html --xpath '//table[@id="WarnTableTable"]' dummy.html` | |
| s2 = s.gsub('<tr>', '') |
This file contains hidden or 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
| curl "http://www.jma.go.jp/jp/warn/346_table.html" | xmllint --html --xpath '//table[@id="WarnTableTable"]' - | sed -e 's/<tr>//g' | sed -e 's/<td.[^>]*>//g' | sed -e 's/<\/td>/,/g' | sed -e 's/<\/tr>/\'$'\n/g' | sed -e 's/<a.[^>]*>//g' | sed -e 's/<\/a>//g' | sed -e '1,2d' | sed -e '$d' | sed -e '$d' | sed -e 's/福岡地方,福<br>岡<br>地<br>方<br>,//g' | sed -e 's/京<br>築<br>,//g' | sed -e 's/北九州地方,北<br>九<br>州<br>・<br>遠<br>賀<br>地<br>区<br>,//g'| sed -e 's/筑豊地方,筑<br>豊<br>地<br>方<br>,//g'| sed -e 's/筑後地方,筑<br>後<br>北<br>部<br>,//g'| sed -e 's/筑<br>後<br>南<br>部<br>,//g' | sed -e 's/<tr.*th>//g' | sed -e 's/^M//' |
This file contains hidden or 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
| require 'bcrypt' | |
| #signup | |
| signup_password = BCrypt::Password.create("my password") | |
| p signup_password | |
| p signup_password.class | |
| to_db = signup_password.to_s | |
| p to_db | |
| p to_db.class |
This file contains hidden or 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
| //see https://www.youtube.com/watch?v=SjjnBMIci2s | |
| //spherov2.js at https://github.com/igbopie/spherov2.js | |
| const { Scanner, Utils } = require('spherov2.js'); | |
| const makeItBlink = async () => { | |
| const spheros = await Scanner.findAllSpheroMini(); | |
| if (!spheros || spheros.length == 0) return console.log('sphero mini not available!'); | |
This file contains hidden or 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 random | |
| class Hand: | |
| hand = ['GUU', 'CHO', 'PA'] | |
| @classmethod | |
| def getHand(cls, i): | |
| return cls.hand[i] | |
| class Strategy: | |
| def nextHand(self): |
This file contains hidden or 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
| class Chara: | |
| def __init__(self): | |
| self.__cs = [] | |
| def add(self, c): | |
| self.__cs.append(c) | |
| def draw(self) : | |
| pass |
This file contains hidden or 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
| class Chara: | |
| def __init__(self): | |
| self.__cs = [] | |
| def add(self, c): | |
| self.__cs.append(c) | |
| def draw(self) : | |
| pass |
This file contains hidden or 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
| class Entry: | |
| def add(): | |
| pass | |
| def getName(): | |
| pass | |
| class File_(Entry): | |
| def __init__(self, name): | |
| self.__name = name | |
| def add(self): |
This file contains hidden or 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
| #!/bin/bash | |
| page=10 #Kindleのページ数をいれる | |
| wid=7374 #brew install smokris/getwindowid/getwindowid でインストールして「getwindowid Kindle --list」を実行した書籍のウィンドウIDを取得していれる | |
| osascript -e 'tell application "Kindle" to activate' | |
| while (( page-- > 0)); do | |
| /usr/sbin/screencapture -l$wid -x -r o/c_`ls o/*png | wc -w | sed 's/^[[:blank:]]*//'`.png | |
| osascript -e 'tell application "System Events" to keystroke (ASCII character 29)' |
This file contains hidden or 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
| //使い方: | |
| // 1. Google Driveのトップにスクリプトを新規作成し以下のコピペする。 | |
| // 2. 抽出したいClassroomの課題フォルダのFOLDER_IDを取得して以下にコピペする | |
| // 3. あとは1で作成したスクリプトを実行する(コード上の実行ボタンを押すだけ)。 | |
| // 4. Google DriveのトップにLatest Submissionsというフォルダができるのでその中に提出された最新ファイルだけがコピーされる。 | |
| function extractLatestSubmissions() { | |
| // Define the folder containing the submissions | |
| var folder = DriveApp.getFolderById("FOLDER_ID"); | |
| // Get all the files in the folder |