Save 37% off PRO during our Black Friday Sale! »

2015年をズザザザザっと 振り返ってみる

B81a8fa35a79d31881ca3d348f3e894a?s=47 pastak
March 13, 2016

2015年をズザザザザっと 振り返ってみる

京大マイコンクラブ( kmc.jp )の2016年春合宿で講座を行った際のスライドです

B81a8fa35a79d31881ca3d348f3e894a?s=128

pastak

March 13, 2016
Tweet

Transcript

  1. 2015೥Λζββββͬͱ ৼΓฦͬͯΈΔ Pasta-K 2016/02/11 pastak@kmc.gr.jp

  2. ͜Μʹͪ͸

  3. ͜Μʹͪ͸

  4. Πϯλʔωοτ׆ಈ twitter.com/pastak id: Pasta-K pastak.hatenablog.com pastak-diary.hatenadiary.com github.com/pastak

  5. KMCͰͷ׆ಈ KMC 37୅໨ ޿ใ OSC Kyotoग़ల ɹYAPCεϙϯαʔ࡞ઓ JavaScriptͰੈքฏ࿨2014

  6. None
  7. KMCͰͷ׆ಈ KMC 37୅໨ ޿ใ OSC Kyotoग़ల ɹYAPCεϙϯαʔ࡞ઓ JavaScriptͰੈքฏ࿨2014 KMCτοϓϖʔδ୲౰ (new)

  8. None
  9. ͜Ε͕๻

  10. ͜Ε͸ௗऔٰ࠭

  11. 8FCαΠτͷ ΦγϟϨԽʹߩݙ

  12. ΦγϟϨ౓ൺֱ      ͜Ε·Ͱ ࠷৽ ※pastakͷମײʹجͮ͘άϥϑ

  13. ΦγϟϨ౓ൺֱ      ͜Ε·Ͱ ࠷৽ ※pastakͷମײʹجͮ͘άϥϑ

  14. ΦγϟϨ౓ൺֱ      ͜Ε·Ͱ ࠷৽ ※pastakͷମײʹجͮ͘άϥϑ ମײൺഒ

  15. ΞϧόΠτ d Πϯλʔϯ Ն Πϯλʔϯ Ն Πϯλʔϯ ౙ

  16. None
  17. None
  18. None
  19. ࣗࡱΓ

  20. None
  21. None
  22. ࣗݾ঺հͷ ࠷ޙʹ ͍ͭ΋ͷ

  23. None
  24. ΞχϝϑΝϯ

  25. None
  26. ࠓ͔ΒԿΛ࿩͢ͷ͔

  27. ๻ͷ2015೥ͷ׆ಈ ʹ͍ͭͯ

  28. None
  29. None
  30. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  31. 4݄ 5݄ 6݄ 7݄ 8݄ 9݄ 10 11 1݄ ɹɹ

    2݄ ɹɹ ࠓ͔Β͜ΕΒ શ෦ͷ࿩Λ βοͱ͢Δͧ
  32. ਂ͘ฉ͖͍ͨ ৔߹͸2" ͔-5Ͱ

  33. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  34. ৽קྫձߨ࠲

  35. http://www.slideshare.net/pastak/javascript-47327211

  36. 8FC"VEJP "1*ͷ࿩ͨ͠

  37. http://pastak.github.io/audio-data-api-sample/

  38. 8FC"VEJP "1*

  39. Web Audio API • ϒϥ΢βͰԻΛ໐Β͢ํ๏ͷ1ͭ • Ұ൪؆୯ͳͷ͸ <audio> • Google

    Chrome / Firefox ڞʹαϙʔτ • Firefox ʹ͸ Audio Data APIͱ͍͏ͷ͕࣮૷ ͞Ε͍͕ͯͨɺͪ͜Βʹ౷Ұ͢Δํ਑ͬΆ͍ • NodeΛ઀ଓ͢Δ͜ͱͰϑΟϧλʔͨ͠Γ৭ʑ ग़དྷΔ
  40. ΦγϨʔλʔ

  41. ภͬͨDTM༻ޠࣙయ - ΦγϨʔλʔ:Oscillatorͱ͸ - DTM / MIDI ༻ޠ ͷҙຯɾղઆ |

    g200kg Music & Software http://www.g200kg.com/jp/docs/dic/oscillator.html ൃৼثͷࣄɻγϯηαΠβʔͰ͸Իͷݩ ͱͳΔ೾ܗΛ࡞Γग़͢෦෼ʹ૬౰͢Δɻ লུͯ͠OSCͱॻ͔ΕΔࣄ΋ଟ͍ɻΧφ දهͷ৔߹͸ʮΦγϨʔλʔʯɺ·ͨ͸ ʮΦογϨʔλʔʯͱॻ͔ΕΔɻ
  42. Իͷ೾Λ࡞Δ΍ͭ

  43. var audioctx = new AudioContext(); var osc = audioctx.createOscillator(); osc.frequency.value

    = 440; osc.type = "square"; osc.connect(audioctx.destination); osc.start(1);
  44. var audioctx = new AudioContext(); var osc = audioctx.createOscillator(); osc.frequency.value

    = 440; osc.type = "square"; osc.connect(audioctx.destination); osc.start(1); प೾਺
  45. var audioctx = new AudioContext(); var osc = audioctx.createOscillator(); osc.frequency.value

    = 440; osc.type = "square"; osc.connect(audioctx.destination); osc.start(1); ೾ܗͷछྨ ɾ"sine" : αΠϯ೾ ɾ"square" : ۣܗ೾ ɾ"sawtooth":ڒࣃঢ়೾ ɾ"triangle":ࡾ֯೾
  46. var audioctx = new AudioContext(); var osc = audioctx.createOscillator(); osc.frequency.value

    = 440; osc.type = "square"; osc.connect(audioctx.destination); osc.start(1); ࠶ੜʂʂʂʂʂʂ
  47. σΟετʔγϣϯΤϑΣΫτ

  48. σΟετʔγϣϯ (Իڹػث) - Wikipedia http://ja.wikipedia.org/wiki/ %E3%83%87%E3%82%A3%E3%82%B9%E3%83%88%E3%83%BC %E3%82%B7%E3%83%A7%E3%83%B3_%28%E9%9F%B3%E9%9F%BF %E6%A9%9F%E5%99%A8%29 σΟετʔγϣϯ (Distortion)͸ɺҙਤత

    ʹ࿪ΜͩʢͻͣΜͩʣԻ৭ΛಘΔΤϑΣ ΫλʔͰ͋Δɻ
  49. ԻΛ࿪·ͤΔ΍ͭ

  50. var shaper = audioctx.createWaveShaper(); osc.connect(shaper); shaper.connect(audioctx.destination); var curve = new

    Float32Array(4096); // ディストーションカーブを表す配列を なんとかして作る shaper.curve = curve;
  51. var shaper = audioctx.createWaveShaper(); osc.connect(shaper); shaper.connect(audioctx.destination); var curve = new

    Float32Array(4096); // ディストーションカーブを表す配列を なんとかして作る shaper.curve = curve; ΦγϨʔλʔͱ઀ଓ͢Δ
  52. Web Audio APIͰଞʹग़དྷΔࣄ • ԻྔΛௐ੔͢Δ • ԻݯΛಡΈࠐΉ • ϑΟϧλʔΛ͔͚Δ •

    ೾ܗΛऔಘ͢Δ • ίϯϓϨοαʔΛ͔͚Δ • ΫϩεϑΣʔυͤ͞Δ ͳͲͳͲ
  53. ɍ

  54. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  55. &MFDUSPO͸ ޙड़

  56. None
  57. What’s “Scratch” • Scratch (εΫϥον) ͱ͸ॳ৺ऀ͕࠷ॳʹਖ਼͠ ͍ߏจͷॻ͖ํΛ֮͑Δ͜ͱແ݁͘ՌΛಘΒ ΕΔϓϩάϥϛϯάݴޠֶश؀ڥͰ͋ΔɻMIT ϝσΟΞϥϘ͕։ൃ͠ɺ༡ͼ৺ͷ͋Δ࣮ݧ΍ ΠϯλϥΫςΟϒΞχϝʔγϣϯɺήʔϜͳ

    Ͳͷ੡࡞Λ௨ͯ͠͞ΒͳΔֶशͷ΍ΔؾΛى ͤ͜͞Δ͜ͱΛҙਤ͍ͯ͠Δɻ https://ja.wikipedia.org/wiki/Scratch_(%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F %E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E) ΑΓ
  58. None
  59. What’s “ScratchX” • ͦͷScratchΛJSͰ֦ுՄೳʹͨ͠΋ͷ • ϒϥ΢βͷίϯςΩετͰར༻Ͱ͖ΔAPIΛ ͢΂ͯར༻Մೳ (XHR, DOM API

    etc ) http://mactkg.hateblo.jp/entry/2015/05/12/020537 ͱ͔͕ৄ͍͠
  60. scratchx-websensor https://github.com/pastak/scratchx-websensor • Scratch্ͰWeb Sensor APIsΛར༻Ͱ͖ΔΑ͏ʹͨ͠΋ͷ • Light sensor •

    Battery Level • Acceleration • Geolocation
  61. $(window).on('devicelight', function(event) { ext.getLightSensor = function(){ return event.originalEvent.value; } })

    return event.originalEvent.accelerationIncludingGravity[direction] } }) ext.getLightSensor = function() {}; ext.getBatteryLevel = function() { return navigator.battery; }; var descriptor = { blocks: [ ['r', 'Light sensor', 'getLightSensor',null], ['r', 'Battery', 'getBatteryLevel',null] ] };
  62. ɍ

  63. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  64. uiureo/ssslack uiureo/ssslack-chrome-extension • SlackͷlogΛऔΓग़ͯ͠อଘͰ͖ΔαʔϏε

  65. pastak/ssslack-firefox-addon • uiureo/sslack-chrome-extensionͱಉ౳ͷৼΔ෣͍Λ ͢ΔFirefoxΞυΦϯ • jpmͰ࡞ͬͨ • jpmʹ͍ͭͯ͸ࡢ೥ͷय़߹॓εϥΠυΛࢀর • http://www.slideshare.net/pastak/firefox-addon-

    sdk
  66. ໰୊ൃੜ

  67. None
  68. None
  69. ͜ͷ෦෼ʹରԠ͢Δ Ϟδϡʔϧ͕jpmʹ͸ͳ͍

  70. KQNͷલ਎ͷ DGYʹ͸͋ΔͷͰ ͦΕΛ࢖͑͹͍͍ ͷͰ͸ʁ

  71. None
  72. ࣦഊ

  73. Ϟδϡʔϧͱ͔͕ ݁ߏมΘͬͯΔ

  74. ͔֬ʹ

  75. ఘΊΑ͏

  76. "1*͋ΔͬΆ͍

  77. ؾ߹͍Ͱ΍ͬͯ ͍͜͏

  78. ؾ࣋ͪ

  79. None
  80. ؾ߹͍Ͱ ॻ͖௚ͨ͠

  81. ग़དྷͨ

  82. https://github.com/pastak/moz-urlbarbutton/

  83. ஌ݟ

  84. var doc = require('sdk/window/utils') .getMostRecentBrowserWindow().document; var urlBarIcons = doc.getElementById('urlbar-icons'); var

    btn = doc.createElement('toolbarbutton'); btn.setAttribute('id', option.id); btn.setAttribute('image', option.image); btn.addEventListener('command', option.onClick, false); urlBarIcons.appendChild(btn);
  85. var doc = require('sdk/window/utils') .getMostRecentBrowserWindow().document; var urlBarIcons = doc.getElementById('urlbar-icons'); var

    btn = doc.createElement('toolbarbutton'); btn.setAttribute('id', option.id); btn.setAttribute('image', option.image); btn.addEventListener('command', option.onClick, false); urlBarIcons.appendChild(btn); ͜ΕͰwindowࣗମͷDOM(ҙ༁)͕औΕΔ
  86. var doc = require('sdk/window/utils') .getMostRecentBrowserWindow().document; var urlBarIcons = doc.getElementById('urlbar-icons'); var

    btn = doc.createElement('toolbarbutton'); btn.setAttribute('id', option.id); btn.setAttribute('image', option.image); btn.addEventListener('command', option.onClick, false); urlBarIcons.appendChild(btn); ͋ͱ͸ҰൠతͳDOMૢ࡞Ͱ<toolbarbutton>Λ௥Ճ
  87. ޙ೔ஊ

  88. KQN޲͚Ϟδϡʔϧ ͱͯ͠GPSLݩʹ औΓࠐ·Εͯ OQNʹެ։͞Εͯͨ

  89. None
  90. None
  91. ɍ

  92. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  93. (ZB[PGPS-JOVY $*ϏϧυϦϦʔε ؀ڥߏங

  94. ͦΕ·Ͱͷ (ZB[PGPS-JOVY

  95. • https://github.com/kambara/Gyazo-for- Linux/downloads ͔Β debϑΝΠϧΛDL • % sudo apt-get install

    ruby imagemagick • % sudo dpkg -i gyazo_XXX_all.deb
  96. ͦΕ͔Βͷ (ZB[PGPS-JOVY

  97. • Debian / Ubuntu • % curl -s https://packagecloud.io/install/ repositories/gyazo/gyazo-for-linux/script.deb.sh

    | sudo bash • % sudo apt-get install gyazo • CentOS • curl -s https://packagecloud.io/install/ repositories/gyazo/gyazo-for-linux/script.rpm.sh | sudo bash • $ sudo yum install gyazo
  98. ԿΛͲ͏͔ͨ͠

  99. ౰࣌ͷঢ়گ • ݩʑNota Incͷ֎෦ͷ༗ࢤ͕࡞ͬͯԼͬͨ͞΋ ͷͩͬͨͷͰɺbuildखॱͳͲΛ஌͍ͬͯΔਓ ͕ࣾ಺ʹډͳ͔ͬͨ • ϦϦʔε΋GitHubͷDownloadػೳΛར༻ͯ͠ ͍͕ͨഇࢭࡁΈͩͬͨ

  100. ࡞ઓํ਑ • ݩʑNota Incͷ֎෦ͷ༗ࢤ͕࡞ͬͯԼͬͨ͞΋ ͷͩͬͨͷͰɺbuildखॱͳͲΛ஌͍ͬͯΔਓ ͕ࣾ಺ʹډͳ͔ͬͨ • ϦϦʔε΋GitHubͷDownloadػೳΛར༻ͯ͠ ͍͕ͨഇࢭࡁΈͩͬͨ →

    ҆ఆͯ͠ϏϧυՄೳͳΑ͏ʹCIͰࣗಈԽ → ΠϯετʔϧΛDebian/Ubuntu͸apt-getͰ ɹ Մೳʹ͢Δ
  101. ಉ࣌ظʹ 13དྷͯͨ

  102. None
  103. 13.ύοέʔδ ΛCVJME͢Δ13

  104. ྆ํͳΜͱ͔ ͏·͘ѻ͑Δ Α͏ʹ͠Α͏

  105. Ϗϧυ༻ͷ$*

  106. CI্ͰͷϏϧυʹ͍ͭͯ • ଞͷϓϩμΫτͰ΋ར༻͍ͯ͠ΔCircleCIΛɹ ར༻͢Δ͜ͱʹ • CIrcleCIͷίϯςφʔOS͸Ubuntu • debύοέʔδͷbuild͸Մೳ ⭕ •

    rpmύοέʔδͷbuild͸ࠔ೉ ❌
  107. $JSDMF$*্Ͱ SQNͷϏϧυ ͍ͨ͠ʂʂʂ

  108. ٹੈओొ৔ʂ

  109. None
  110. %PDLFS ʹ͍ͭͯ ஌Γ͍ͨਓ

  111. ͜ͷ͋ͱͷ XBTT͘Μͷ ߨ࠲ΛݟΑ͏

  112. from http://techtarget.itmedia.co.jp/tt/news/1408/21/news02.html

  113. ղܾҊ

  114. None
  115. Ͱ

  116. Ͳ͔ʔΜͱ

  117. $JSDMF$*ͷ 6CVOUVʹ

  118. $FOU04 ߏங

  119. None
  120. None
  121. Ϗϧυ੒ޭʂ

  122. None
  123. BQUJUVEFZVN޲͚ʹ SFQPTJUPSZΛެ։͢Δ

  124. None
  125. packagecloud.ioΛར༻ • ެ։༻ͳΒແྉͰ݁ߏ࢖͑Δ • upload༻ͷίϚϯυ͸gem • gem install packagecloud •

    CircleCIͷυΩϡϝϯτʹ΋ࡌͬͯΔ • https://circleci.com/docs/pushing-packages-to- packagecloud
  126. packagecloudͰϦϦʔε • $user/$repo/$os/$versionΛࢦఆ͢Δ • packagecloudͷఏڙ͍ͯ͠Δinstall.sh͸ɺɹ/etc/ debian_versionͳͲΛಡΜͰɺ$osͱ$version͕ݻఆ͞ΕΔ ͷͰɺͦΕͧΕʹରԠͨ͠ϑΝΠϧΛpush͢Δඞཁ͕͋Δ • ͲΜͲΜσΟετϦ૿͑ΔͷͰɺϦϦʔε࣌ʹ https://

    packagecloud.io/api/v1/distributions.json ΛಡΜͰλʔ ήοτΛऔಘ͢Δ • ͋ͱ͸ઌ΄ͲͷཁྖͰbuildͨ͠΋ͷΛͲΜͲΜpush͢Δ
  127. 5SZJU

  128. ɍ

  129. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  130. ϋοΧιϯத

  131. None
  132. ௨஌ۂ໊౳͕ 6OEFpOFEʹ

  133. Ͳ͏΍Βಛఆͷ ָۂͰى͖Δ

  134. ͦͷָۂ͕ ͪ͜Β

  135. None
  136. None
  137. ոͦ͠͏ͳ෦෼

  138. None
  139. None
  140. νʔϜϋφϠ Ϛλ

  141. \OBNFՖϋགྷϨϠ͍Ζ ͸ʹ΄ BSUJTUνʔϜ ϋφϠϚλ BMCVNՖ ϋགྷϨϠ͍Ζ͸ʹ΄&1^

  142. KXBMHSBOQMBZCBDL Λؾ߹͍Ͱ ௚ͦ͏ͱ͢Δ

  143. J5VOFTΛୟͨ͘Ίʹ "QQMF4DSJQUͰؾ߹͍Ͱ +40/ੜ੒ͯͨ͠

  144. ඪ४ͷ "QQMF4DSJQU ͚ͩͰ͸ਖ਼نදݱͳͲ͕ ෆՄೳ

  145. ͦ͏͍͑͹ʜ

  146. +BWB4DSJQU GPS "VUPNBUJPO

  147. JT

  148. :FU"OPUIFS "QQMF4DSJQU

  149. JavaScript for Automation(JXA) • Mac OSX 10.10 Yosemite ͔Βར༻Մೳʹ •

    ͦΕ·ͰͷApple Scriptͱಉ౳ͷ͜ͱΛJSͰදݱՄೳʹ • ެࣜυΩϡϝϯτ: https://developer.apple.com/library/ mac/releasenotes/InterapplicationCommunication/RN- JavaScriptForAutomation/Articles/Introduction.html • αϯϓϧ๛෋: https://github.com/dtinth/JXA-Cookbook • Script Editor.app > ΢Οϯυ΢ > ϥΠϒϥϦ
  150. #FGPSF

  151. on IsPlaying() tell ApplicationLib if ApplicationIsRunning("iTunes") then tell application "iTunes"

    return player state is playing end tell else return false end if end tell end IsPlaying on GetCurrentTrack() if IsPlaying() then tell application "iTunes" if not (exists current track) then return null set trackName to (get name of current track) set trackArtist to (get artist of current track) set trackAlbum to (get album of current track) return "{\"name\":\"" & trackName & "\",\"artist\":\"" & trackArtist & "\",\"album\":\"" & trackAlbum & "\"}" end tell else return "null" end if end GetCurrentTrack
  152. on IsPlaying() tell ApplicationLib if ApplicationIsRunning("iTunes") then tell application "iTunes"

    return player state is playing end tell else return false end if end tell end IsPlaying on GetCurrentTrack() if IsPlaying() then tell application "iTunes" if not (exists current track) then return null set trackName to (get name of current track) set trackArtist to (get artist of current track) set trackAlbum to (get album of current track) return "{\"name\":\"" & trackName & "\",\"artist\":\"" & trackArtist & "\",\"album\":\"" & trackAlbum & "\"}" end tell else return "null" end if end GetCurrentTrack
  153. "GUFS

  154. function IsPlaying() { if (IsRunning()) { return Application('iTunes').playerState() === 'playing'

    } return false } function GetCurrentTrack() { if (!IsPlaying()) { return null } var iTunes = Application('iTunes') var track = iTunes.currentTrack return JSON.stringify({ name: track.name(), artist: track.artist(), album: track.album() }) }
  155. ɍ

  156. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  157. (BNF1BE "1*

  158. GamePad API ֓ཁ • USB GamePad ͳͲͷೖྗΛऔಘͰ͖ΔJS API • https://www.w3.org/TR/gamepad/

    • https://developer.mozilla.org/en-US/docs/Web/API/ Gamepad_API/Using_the_Gamepad_API • gamepadconnected Event • event.gamepad • gamepaddisconnected Event • navigator.getGamepads() • Array͕ฦͬͯ͘Δ͕ɺChromeͩͱlength > 3 Ͱ undefinedͰຒ·ͬͨͷ͕ฦͬͯ͘Δʢͩͬͨ͸ͣ)
  159. GamePad API ֓ཁ • GamePad.index • GamePad.id • GamePad.buttons •

    Buttonͷ഑ྻʢϘλϯ͝ͱʹ൪஍͕ݻఆ͞Ε͍ͯΔʣ • GamePad.axes • εςΟοΫͷ܏͖۩߹ʢेࣈϘλϯ΋ؚ·ΕΔ৔߹΋ • Button.pressed • Button.value • Ϙλϯͷԡ͞Ε۩߹
  160. .FOVCBS"QQ XJUI&MFDUSPO

  161. 8IBU`T &MFDUSPO

  162. http://qiita.com/pastak/items/108d34d19927f26de0d0

  163. ElectronͰMenubarৗறΞϓϦ • maxogden/menubar Λར༻͢Δͱmenubarʹৗற͠ ͯɺ͔ͦ͜Βੜ͑ͯ͘ΔΑ͏ʹ΢Οϯυ΢Λදࣔ͢Δ ΞϓϦέʔγϣϯΛॻ͘͜ͱ͕ग़དྷΔ • ϝχϡʔΛग़͚ͩ͢ͳΒɺˢ͸ෆཁ • https://github.com/atom/electron/blob/master/

    docs/api/menu.md • https://github.com/atom/electron/blob/master/ docs/api/menu-item.md
  164. https://github.com/pastak/gyazo-menubar https://github.com/pastak/electonic-ninetan

  165. menubar ϞδϡʔϧΛར༻ const menubar = require('menubar') const mb = menubar()

    mb.on('ready', function ready () { const loadPath = 'file://'+ __dirname+'/static/view.html' mb.window.loadUrl(loadPath) })
  166. menubar Ϟδϡʔϧඇར༻ const Menu = require('electron').Menu const menu = new

    Menu(); menu.append(new MenuItem({ label: 'MenuItem1', click: function() { console.log('item 1 clicked') } })) menu.append(new MenuItem({type: 'separator'})) menu.append(new MenuItem({ label: 'MenuItem2', type: 'checkbox', checked: true }))
  167. ɍ

  168. 10݄

  169. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: GamePad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  170. QBTTXPSE Έ͍ͨʹ &MFDUSPO"QQͱ $ISPNF&YUΛ ࿈ܞ͍ͤͨ͞ ※1password͸ElectronAppͰ͸ͳ͍

  171. QBTTXPSEͷ $ISPNF&YU؍࡯

  172. XFCTPDLFUΛ ར༻͍ͯ͠ΔͬΆ͍

  173. ͳΔ΄Ͳ

  174. ΍ͬͯΈΑ͏

  175. 8FC4PDLFUPO &MFDUSPO"QQ

  176. Πϝʔδਤ

  177. ᶃ ىಈͯ͘͠Ε! ᶄ ͪ͜ΒͰ͢ ᶅ ྑ͍ײ͡ʹ ɹඈΜͰ͖ͨ৘ใΛ ɹར༻

  178. Electron App Side const ws = require("nodejs-websocket") const server =

    ws.createServer(function (conn) { console.log("New connection") conn.on("text", function (text) { if (text !== 'open') return console.log('called') do_something() // ② }) conn.on("close", function (code, reason) { console.log("Connection closed") }) }).listen(3652)
  179. Chrome Extension Side var ws = new WebSocket('ws://localhost:3652/') ws.onmessage =

    function (event) { //適切にwsで飛んできたdataを渡す res(event.data) // ③ ws.close() } ws.onopen = function () { ws.send('open') // ① }
  180. %&.0

  181. ɍ

  182. 11݄

  183. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  184. ݄෼Ͱ ·ͱΊͯ ࿩͢

  185. ɍ

  186. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  187. 'JUCJU

  188. http://www.slideshare.net/pastak/2016fitbit

  189. $ISPNF&YUFOTJPO #VJME3FMFBTF ࣗಈԽେ࡞ઓ

  190. ·ͣ$-*πʔϧ Λॻ͍ͨ

  191. DISPNFXFCTUPSF NBOBHFS

  192. chrome-webstore-manager • Google OAuthͷaccess_tokenऔಘ • ೝূʹ͸ϒϥ΢β͕ඞཁ • refresh_tokenऔಘ • Extensionͷొ࿥

    / ߋ৽ / ެ։
  193. $*ͩͱUPLFOΛ ӬଓԽग़དྷͳ͍

  194. ӬଓԽͰ͖Δ Α͏ʹͨ͠Β ྑͦ͞͏

  195. Πϝʔδਤ

  196. GitHubͰPRΛ merge refresh token Kick! extension.zip ΛPOST upload & publish

    ݁ՌΛ௨஌ %#ʹ UPLFOΛೖΕΔʂ ։ൃऀ
  197. None
  198. DISPNFXFCTUPSF NBOBHFSͷػೳΛ SFRVJSFͰ͖ΔΑ͏ʹ

  199. αʔό΋ /PEF+4 Ͱγϡοͱ

  200. LPB

  201. What’s “koa” • 1.x ͸ generator • 2.x ͸ await

    / async • CallBack஍ࠈͱexpress͔Βͷ୤٫
  202. koa’s middleware pattern • functionΛొ࿥ॱʹݺͿ const koa = require('koa') const

    app = koa() app.use(function *(next) { this.body = 'Hello' yield next }) app.use(function *(next) { this.body += 'World' yield next }) app.listen(3000)
  203. router.get('/callback', function *(next) { const callbackUrl = `${this.request.origin}/callback` const tokenData

    = yield chromeWebstoreManager.getAccessToken(query['code'], callbackUrl).then((data) => { data = JSON.parse(data) data.expired_at = Date.now() + (Number(data.expires_in) * 1000) return data }) try { yield setToken(JSON.stringify(tokenData)) this.body = 'Success!' } catch (e) { this.status = 500 this.body = 'failed...' } })
  204. ׬੒඼͕ ͪ͜Β

  205. https://github.com/pastak/chrome-extension-release-heroku

  206. IFSPLVEFQMPZ ϘλϯҰൃͰ ଈ͝ར։࢝༻Մೳ

  207. HZB[PHZB[P DISPNF FYUFOTJPO Ͱӡ༻த

  208. ɍ

  209. 4݄: audio API 5݄: Electronࢼ࢝͠ΊΔ / ScratchX 6݄: Firefox Add-on

    module 7݄: Build deb package on Circle CI 8݄: JavaScript for Automation (JXA) 9݄: Gamepad API / Menubar with Electron 10݄: Connection Electron App with Chrome Extension 11݄: Chrome Extension Build Tool / heroku / koa.js 1݄: Fitbit ɹɹ Auto release Chrome Extension with heroku 2݄: Open CV with NodeJS on heroku by Docker ɹɹ Format manifest.json for Firefox WebExtension
  210. QBTUBLOFU υϝΠϯΛ࢖ͬͯ IFSPLV্Ͱ ༡ͿϒʔϜ౸དྷ

  211. HBMMFSZ QBTUBLOFU

  212. None
  213. ݟͲ͜Ζ

  214. XIBUXHGFUDI 3FBDU

  215. HPTFJ QBTUBLOFU http://192.168.220.16:3002/

  216. XFC্ͷը૾ʹ QBTUBLΛ ߹੒Ͱ͖Δ

  217. None
  218. None
  219. None
  220. None
  221. ݟͲ͜Ζ

  222. DBOWBTͰ͸ $034ͷΞϨͰ Կ΋ग़དྷͳ͍

  223. ཪͰJNBHFNBHJDL ୟ͍ͯ߹੒ͯ͠Δ

  224. LBPIBNF HFOFSBUPS IFSPLVBQQDPN

  225. إࣸਅΛ Ξοϓϩʔυ͢Δͱ إϋϝ؃൘ͷࣸਅʹ ߹੒ͯ͘͠ΕΔ

  226. None
  227. None
  228. Πϝʔδਤ

  229. ࣗ෼ͷࣸਅ ΠϯλʔωοτͰऩूͨ͠ إϋϝ؃൘ه೦ࣸਅ

  230. ࣗ෼ͷࣸਅ ΠϯλʔωοτͰऩूͨ͠ إϋϝ؃൘ه೦ࣸਅ OpenCVͰإΛݟ͚ͭΔ

  231. ࣗ෼ͷࣸਅ ΠϯλʔωοτͰऩूͨ͠ إϋϝ؃൘ه೦ࣸਅ إΛϦαΠζͯ͠إϋϝ؃൘ը૾ʹҠ২

  232. ࣗ෼ͷࣸਅ ΠϯλʔωοτͰऩूͨ͠ إϋϝ؃൘ه೦ࣸਅ

  233. ݟͲ͜Ζ

  234. None
  235. ج൫͸heroku

  236. ج൫͸heroku Docker on heroku

  237. ج൫͸heroku Docker on heroku Running OpenCV node-opencv

  238. 8IZ %PDLFS

  239. Կނherokuͷ্Ͱdockerͳͷ͔ • σϑΥϧτͷheroku্ͷUbuntuʹ͸OpenCV ͕ͳ͍ • Buildͯ͠ར༻Ͱ͖ΔΑ͏ʹͯ͠΍Δඞཁ͕ ͋Δ

  240. Build and Deploy Docker to Heroku % heroku plugins:install heroku-docker

    % echo “web: npm run start” > Procfile % heroku docker:init % docker-compose build % heroku docker:release heroku-dockerϓϥάΠϯΛΠϯετʔϧ ProcfileΛੜ੒ جຊతͳDockerfileͳͲ͕ੜ੒͞ΕΔ docker imageΛbuild herokuʹdeploy
  241. ஫ҙ఺ • DockerfileͷFROMʹࢦఆ͢Δͷ͸heroku/ cederΛϕʔεʹͨ͠imageͰ͋Δඞཁ͕͋Δ • heroku/nodejs, heroku/ruby, heroku/python, heroku/go, heroku/java,

    heroku/gradle, heroku/scala
  242. IFSPLV্Ͱ࢖͑Δ Α͏ʹ0QFO$7Λ CVJMEͨ͠JNBHF Λ࡞Δ

  243. Docker imageͷ࡞Γํ • ͗͢ΌʔΜ͞Μͷ sugyan/heroku-python- opencv Λࢀߟʹ • ͗͢ΌʔΜ͞Μͷ͸Python༻ͳͷͰɺͦΕΛ ࢀߟʹOpenCVͷBuildΛͯ͠heroku/nodejs

    ΛࢀߟʹNodeJSΛಋೖ͢Δ
  244. ׬੒඼

  245. None
  246. ͝ར༻ ͍ͩ͘͞

  247. 8FC &YUFOTJPO

  248. 'JSFGPYͰ ಈ࡞ՄೳʹͳΔ ϒϥ΢β֦ுͷܗࣜ

  249. ڈ೥ͷ ߨ࠲

  250. http://www.slideshare.net/pastak/firefox-addon-sdk

  251. ͓͞Β͍

  252. Firefoxͷϒϥ΢β֦ுܗࣜ • XUL + XPCOMΛ༻͍ͨ։ൃ • Addon-SDKΛ༻͍ͨ։ൃ (crx / jpm)

  253. Firefoxͷϒϥ΢β֦ுܗࣜ • XUL + XPCOMΛ༻͍ͨ։ൃ • Addon-SDKΛ༻͍ͨ։ൃ (crx / jpm)

    • ChromeExtensionޓ׵ͷίʔυ (new)
  254. ڈ೥ͷ ,.$Ξυϕϯτ ΧϨϯμʔ

  255. http://pastak.hatenablog.com/entry/2015/12/05/013527

  256. ࠷৽ͷݱঢ় • Firefox v46 (ݱࡏDE, Canary) Ͱalphaʹͳͬͨ • 2016-08-02ʹstableೖΓ͢Δ༧ఆͷFirefox v48Ͱ

    stableʹͳΔ໨ඪ • chrome -> browser • addon.mozilla.org ʹΞοϓϩʔυ͢Δ͜ͱͰॺ໊ Մೳʹ • ະ࣮૷ͷAPI΋͔ͳΓݮ͖ͬͯͨ • https://developer.mozilla.org/en-US/Add-ons/ WebExtensions/Chrome_incompatibilities
  257. NBOJGFTUKTPO ඇޓ׵໰୊

  258. manifest.jsonඇޓ׵໰୊ • ͍͔ͭ͘ͷະ࣮૷Ωʔ • ͍͔ͭ͘ͷະ࣮૷ϓϩύςΟ • ChromeExtensionͰ͸(ݱঢ়)invalidͳ applicationΩʔ

  259. manifest.jsonඇޓ׵໰୊ • ͍͔ͭ͘ͷະ࣮૷Ωʔ • ͍͔ͭ͘ͷະ࣮૷ϓϩύςΟ • ChromeExtensionͰ͸(ݱঢ়)invalidͳ applicationΩʔ Firefoxʹ ΠϯετʔϧෆՄ

  260. manifest.jsonඇޓ׵໰୊ • ͍͔ͭ͘ͷະ࣮૷Ωʔ • ͍͔ͭ͘ͷະ࣮૷ϓϩύςΟ • ChromeExtensionͰ͸(ݱঢ়)invalidͳ applicationΩʔ Firefoxʹ ΠϯετʔϧෆՄ

    Chromeʹ ΠϯετʔϧෆՄ
  261. ݱঢ়྆ํͰಈ͘ NBOJGFTUKTPO ͸࡞Εͳ͍

  262. None
  263. NBOJGFTUKTPO ͳΜͱ͔ͯ͘͠ΕΔ܅ ࡞ͬͨ

  264. 8FC&YUFOTJPO .BOJGFTU 'PSNBUUFS

  265. https://github.com/pastak/wemf

  266. What’s wemf • ඞؚͣ·Ε͍ͯΔ΂͖ΩʔͱରԠ͢Δ஋Λ௥Ճ • ෆ଍͍ͯ͠ΔΩʔ͕͋Δ৔߹͸ package.json ͳͲ͔Βੜ੒ͭ͠ ͭɺର࿩ΠϯλʔϑΣΠεͰੜ੒͠·͢ •

    ະରԠͷΩʔΛ࡟আ • ݱঢ়ະରԠͷΩʔ͕͋ΔͱΠϯετʔϧʹࣦഊ͢ΔͷͰɺͦͷ Α͏ͳΩʔΛ࡟আ͠·͢ɻ • ະରԠͷΩʔϫʔυͷ࢖༻Λ௨஌ • web_accessible_resourcesͰϫΠϧυΧʔυ͕࢖͑ͳ͍ͳͲ͕ ͋ΔͷͰɺͦͷΑ͏ͳΩʔϫʔυΛؚΜͰ͍Δ৔߹͸࡟আͤͣ ʹ௨஌͠·͢ɻ
  267. ɍ

  268. ࠷ޙʹ

  269. ࠓ೥΋ָ͍͠ ̍೥ʹ͠Α͏