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
//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 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 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 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 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
data = [] | |
while s = gets | |
data << s.chomp | |
end | |
tmp = {} | |
data.each do |item| | |
if tmp.has_key?(item) then | |
tmp[item] << item | |
else |
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
cnt = 1 | |
prev_s = "" | |
while s = gets do | |
s.chomp! | |
if prev_s == "" then | |
prev_s = s | |
next | |
end |
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
void setup() { | |
size(400, 400); | |
stroke(255); | |
noLoop(); | |
} | |
void draw() { | |
background(255); | |
stroke(255, 0, 0); | |
fill(255, 0, 0); |
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
void setup() { | |
size(800,400); | |
} | |
void draw() { | |
background(0, 255, 255); | |
float y = 0; | |
for (int i = 1; i <= 5; i++) { | |
y += 24 * (i - 1); | |
drawOutlineText("Hello, Processing World!", 0, y, 24 * i, color(255), color(0)); |
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
/* | |
This program is free software; you can redistribute it and/or modify it | |
under the terms of the GNU Library General Public License as published | |
by the Free Software Foundation; either version 2, or (at your option) | |
any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
Library General Public License for more details. |
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: findNoTextPdf.sh path" | |
exit 1 | |
fi | |
find $1 -type f -name "*.pdf" | while read myfile | |
do | |
pdftotext -l 1 "$myfile" tmp | |
status=`hexdump -ve '1/1 "%.2x"' tmp | head -c 2` |