https://openbook4.me/projects/92
まえやってたやつの1章やってる間にこっちだと全部できちゃう。
Gitとか余計な内容がないのと、Rubyの話とか少なくて、Railsの話の割合が高くて良い感じ。
最初からこっちやっとくべきでした。
もし今までやってた外人の日本語訳のサイトやるなら、こっちやってからの方が良い気がします。

Linux、Debian、Ubuntu、プログラミング、ゲーム、各種プログラムの話題とキントレ、ダイエット、教育等
https://openbook4.me/projects/92
まえやってたやつの1章やってる間にこっちだと全部できちゃう。
Gitとか余計な内容がないのと、Rubyの話とか少なくて、Railsの話の割合が高くて良い感じ。
最初からこっちやっとくべきでした。
もし今までやってた外人の日本語訳のサイトやるなら、こっちやってからの方が良い気がします。
{
"name" : "helloworld",
"version" : "0.0.1",
"manifest_version" : 2,
"description" : "Hello World Chrome Extension"
}
chrome_addon_000
└── js
└── manifest.json
1 directory, 1 file
{
"name" : "helloworld",
"version" : "0.0.1",
"manifest_version" : 2,
"description" : "Hello World Chrome Extension",
"content_scripts" : [{
"matches" : ["https://blog.123abcsoft.com/*"],
"js" : [
"helloworld.js"
]
}]
}
console.log("Hello World"); alert("Hello World");
chrome_addon_001_helloworld/
└── js
├── helloworld.js
└── manifest.json
1 directory, 2 files
{
"name" : "helloworld",
"version" : "0.0.2",
"manifest_version" : 2,
"description" : "Hello World Chrome Extension",
"content_scripts" : [{
"matches" : ["https://blog.123abcsoft.com/*"],
"js" : [
"helloworld.js"
]
}],
"icons" : {
"128" : "images/fractal128.png"
}
}
convert -size 128x128 plasma:fractal fractal128.png
chrome_addon_002_add_icon/
└── js
├── helloworld.js
├── images
│ └── fractal128.png
└── manifest.json
2 directories, 3 files
{
"name" : "helloworld",
"version" : "0.0.3",
"manifest_version" : 2,
"description" : "Hello World Chrome Extension",
"permissions": ["storage"],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts" : [{
"matches" : ["https://blog.123abcsoft.com/*"],
"js" : [
"helloworld.js"
]
}],
"icons" : {
"128" : "images/fractal128.png"
}
}
chrome.runtime.onInstalled.addListener(function() {
chrome.storage.sync.set({helloworldtext : 'Hello World!'}, function() {
chrome.storage.sync.get('helloworldtext', function(data) {
console.log("storage variale helloworldtext is '"+data.helloworldtext+"'");
});
});
});
chrome.storage.sync.get('helloworldtext', function(data) {
console.log(data.helloworldtext);
alert(data.helloworldtext);
});
convert -size 128x128 plasma:fractal fractal128.png
chrome_addon_003_add_backgroud.js/
└── js
├── background.js
├── helloworld.js
├── images
│ └── fractal128.png
└── manifest.json
2 directories, 4 files
{
"name" : "helloworld",
"version" : "0.0.4",
"manifest_version" : 2,
"description" : "Hello World Chrome Extension",
"permissions": ["storage"],
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts" : [{
"matches" : ["https://blog.123abcsoft.com/*"],
"js" : [
"helloworld.js"
]
}],
"options_page": "options.html",
"icons" : {
"128" : "images/fractal128.png"
}
}
<!DOCTYPE html> <html> <head> <style> </style> </head> <body> <script src="./jquery-3.4.1.min.js"></script> <div id="textInput"> <input id="mytext"></input> </div> <div> <p>text for log and alart</p> </div> </body> <script src="options.js"></script> </html>
$('#mytext').change(function() { chrome.storage.sync.set({helloworldtext : $(this).val()}, function(data) { chrome.storage.sync.get('helloworldtext', function(data) { console.log("storage variale helloworldtext is '"+data.helloworldtext+"'"); }); }); }); chrome.storage.sync.get('helloworldtext', function(data) { console.log(data.helloworldtext); $('#mytext').val(data.helloworldtext); });
chrome_addon_004_add_options/
└── js
├── background.js
├── helloworld.js
├── images
│ └── fractal128.png
├── jquery-3.4.1.min.js
├── manifest.json
├── options.html
└── options.js
2 directories, 7 files
Created: 2019-06-28 金 12:51
非常に簡単なgoogleアドオン作ってみました。
動画とブログに文書あげます。ちかいうちに
タイトルと、文字列で対戦相手の方のユーザー名がはいってしまってるのを、デベロッパーツールのインスペクタと、コンソールからのコマンド入力で変更している動画になってます。
以下が動画で実行した時のコマンドや、それに対するレスポンス
document.title
"将棋ウォーズ棋譜(XXXXX 1級対NM_Max_game29級)"
document.title="将棋ウォーズ棋譜(OOOOOOO 1級対NM_Max_game29級)"
"将棋ウォーズ棋譜(OOOOOOO 1級対NM_Max_game29級)"
$('#area_sente > a').text()
"XXXXXXX1級"
$('#area_sente > a').text("JJJJJJJJJ 1級")
init [a, prevObject: init(1), context: document, selector: "#area_sente > a"]
$('#area_sente > a').text("ZZZZZZZZZ 1級")
init [a, prevObject: init(1), context: document, selector: "#area_sente > a"]
相手が1級で実力差がありすぎました!
でも最後まで頑張ったよ!
Created: 2019-06-17 月 07:41
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <script src="https://cesiumjs.org/releases/1.58/Build/Cesium/Cesium.js"></script> <link href="https://cesiumjs.org/releases/1.58/Build/Cesium/Widgets/widgets.css" rel="stylesheet"> </head> <body> <div id="cesiumContainer" style="width: 100%; height: 100%"></div> <script> <!-- Cesium.Ion.defaultAccessToken = 'your_access_token'; --> var viewer = new Cesium.Viewer('cesiumContainer'); </script> </body> </html>
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:DocumentRoot => "./", :Port => 8000).start'
viewer.camera.positionCartographic
{longitude: 2.4438235206124967, latitude: 0.6225373613176627, height: 137921.4350234892}
viewer.camera.flyHome();
viewer.camera.flyTo({destination : Cesium.Cartesian3.fromRadians(2.4438235206124967, 0.6225373613176627, 150000.0)})
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <script src="https://cesiumjs.org/releases/1.58/Build/Cesium/Cesium.js"></script> <link href="https://cesiumjs.org/releases/1.58/Build/Cesium/Widgets/widgets.css" rel="stylesheet"> </head> <body> <div id="cesiumContainer" style="width: 100%; height: 100%"></div> <script> <!-- Cesium.Ion.defaultAccessToken = 'your_access_token'; --> var viewer = new Cesium.Viewer('cesiumContainer'); </script> <script> var flyto_tokyo=function() { viewer.camera.flyTo({destination : Cesium.Cartesian3.fromRadians(2.4438235206124967, 0.6225373613176627, 150000.0)}) } </script> <button id="flyto_tokyo" onclick="flyto_tokyo()">東京へflyto</button> </body> </html>
Created: 2019-06-17 月 07:34
Googlemap APIで、距離とか時間とか、経路の決め方のオプション与えてJavaScriptで組みました。
keyが必要になってしまうので、このブログで公開はできないんだけど、ライセンスのとり方で過大な請求来ない方法で公開できそうだったら、公開しちゃうかも
https://developers.google.com/maps/documentation/directions/start
にやり方書いてあります。オプションの与え方とか
ネット検索でソースコードと比較しながら、つかってみるとGoogle様の設計が良いので非常に使いやすいライブラリとなっていました。
色々な経路を計算するたびに費用がかかってくるケースもあるので、一度計算したルートを保存しとこうとしたんだけど、大阪駅と東京駅の経路だいたい5M弱もあって断念しました。
などを帰ってきた、情報から比較的簡単に抜き出すことが可能でした。
本当に使いやすいライブラリで、見た目も美しく、またGooglemapを使う案件やりたいな
3Dマウス副業の関係で購入しました。初めて使うので操作方法最初はわかりませんでした。
3DConnectionの SpaceMouse Compact っていうやつです。
https://www.3dconnexion.jp/spacemouse_compact/jp/
6軸+2ボタンとして、Chromeで反応するので、イベント毎に処理を書いてやる感じで、Chrome用のJavaScript作れました。
良い値段するのと、デバイスドライバを入れないといけないなど、不便な面もあって、どこまで普及するのかわからないけど。
値段と機能を考えると、勝者にならない気がする。2万弱もしました。
CesiumJSっていう素晴らしいソフトがあって、美しい地球儀みたいなもの
こんな感じでグリグリできて美しい。今回の仕事の知識でブログへの埋め込みにも成功しました。
やってみたら上手くいった!
宇宙旅行も可能みたいで、月とか太陽も訪問可能で、自分のデータも入れてカスタマイズ出来るみたいです。やり方まだわかってないけど、そこら。
https://cesium.com/docs/tutorials/getting-started/#your-first-app
を読んでもらえば、やり方わかると思います。
素晴らしいですね、数行でこんなのを埋め込んだページつくれちゃうって、本当にすごい!
カメラ操作も非常に簡単にできて、地球を色々なところ飛びまわるとか、WindowsのChromeならGamepad APIに対応していて、Gamepad で操作をカスタマイズも可能。
当然マウスやキーボード操作に対する反応もカスタマイズ可能です。
フライトの記録とかがあれば、それを再現も比較的低い難易度で出来るソフトです。
本当に素晴らしいソフト。