Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hacking Home
Search
Akira Matsuda
April 19, 2014
Programming
31
6.3k
Hacking Home
大江戸Ruby会議04の講演"Hacking Home"のスライド
http://regional.rubykaigi.org/oedo04
#oedo04
Akira Matsuda
April 19, 2014
Tweet
Share
More Decks by Akira Matsuda
See All by Akira Matsuda
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
13
4.7k
Hanamiを支える技術 2023 / Asakusa.rb Hanami 2023
a_matsuda
2
530
Rails 7.1をn倍速くした話
a_matsuda
11
12k
RubyKaigi 2022 After Talk
a_matsuda
0
400
Coming Soon…💎 / coming soon
a_matsuda
12
7.7k
Rails Performance Issues and Solutions
a_matsuda
9
35k
Extending Rails for Real World App Development
a_matsuda
9
7.4k
A RubyKaigi Talk
a_matsuda
8
2.3k
Ginza Rails 1
a_matsuda
6
1.2k
Other Decks in Programming
See All in Programming
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
Click-free releases & the making of a CLI app
oheyadam
2
110
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Better Code Design in PHP
afilina
PRO
0
120
Featured
See All Featured
Thoughts on Productivity
jonyablonski
67
4.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Unsuck your backbone
ammeep
668
57k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Ruby is Unlike a Banana
tanoku
97
11k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Visualization
eitanlees
145
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Teambox: Starting and Learning
jrom
133
8.8k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Transcript
Hacking (My) Home Akira Matsuda
self • GitHub: amatsuda • Twitter: @a_matsuda
Asakusa.rbओ࠵ͯ͠·͢
None
աڈͷେߐށRubyձٞ • 01 => جௐߨԋ • 02 => Dave Thomas͔ͬͯ͠ͳ͍
(͚ͲDaveݺΜͩͷΦϨΦϨ) • 03 => جௐߨԋ
04 (Date.today) • Ebi & Aaron • aamine • ko1
& Yuki Sasada • zzak • hone • Kawamoto • ...
No technical talk from me today!
Actually, no code in the slides!
ʮੜ׆ൃදձʯ
My next technical talk will be at RailsConf 2014 •
At Chicago • Next week
ʮAsakusa.rbͷ ୈ256ճͷmeetupʯ
ઙ.rbཱϝϯόʔ • amatsuda => ઙ • kakutani => ྆ࠃ •
ko1 => ຊॴޗ࠺ڮ
ઙ.rbཱϝϯόʔ • amatsuda => ઙ • kakutani => ྆ࠃ •
ko1 => ຊॴޗ࠺ڮ Ͳ͔ͬӈͷ΄͏
TBH I do no more live in ઙ • amatsuda
=> ઙ ࠜ • kakutani => ྆ࠃ • ko1 => ຊॴޗ࠺ڮ
Life in ઙ • 2004ʹఆՁ3,800ສԁͷ ৽ஙϚϯγϣϯΛߪೖ • 10ؒډॅ • ϚϯγϣϯݱࡏିͰӡ༻த
ച٫ʁିʁ
ച٫ʹ͋ͨͬͯ • ࢿ࢈ධՁֹͷݟੵΓ
2012࣌ • 3,500ສԁ (by େखۜߦܥۚ༥ػؔ)
ࢿ࢈ՁͷݮΓֹ • 2004: 3800ສ • 2012: 3500ສ • => 37.5ສ
/ year • => 3.125ສ / month
Α͋͘Δޡղ (1)
ିऩೖ • 18.5ສ / month • 18.5ສ * 12 =
222ສ / year • 3800.0ສ / 222ສ = 17.117...
ି݅ͷݪࢿճऩ17
େՈ͞ΜΛͬͯΈͯ Θ͔ͬͨ͜ͱ • Ոͱ͔ཧඅͱ͔ͷઃఆ͖ͯͱ͏ • ΒΕΔ͜ͱΛݟࠐΜͩՁ֨ઃఆ
େՈۀ·ͱΊ • ࢿ࢈ՁͷݮΓ: 3.125ສ / month • ିऩೖ: 18.5ສ /
month
Α͋͘Δޡղ (2) • ෆಈ࢈Λങͬͯ͠·͏ͱ Ҿͬӽͤͳ͘ͳΔʁ
ઙʹ10ॅΜͩͷͰ Ҿͬӽͯ͠Έ·ͨ͠ɻ
લճϚϯγϣϯ͔ͩͬͨΒ ࠓށݐͯʹͯ͠Έ·ͨ͠ɻ
ށݐͯ vs. Ϛϯγϣϯ • ށݐͯͷ΄͏͕͍Ζ͍Ζ͍͠ • ށݐͯͷ΄͏͕͍Ζ͍Ζࣗ༝͕ߴ͍
ށݐͯͷ΄͏͕͍͠ • ษڧ͠ͳ͖Ό͍͚ͳ͍͜ͱ͕ଟ͍ • εςʔΫϗϧμʔ͕ଟ͍
ϚϯγϣϯߪೖλΠϜϥΠϯ • ݅બఆ • आۚ & ܖ • ɺೖډ
ށݐͯߪೖλΠϜϥΠϯ • ͷܖ • आۚ • ͷߪೖ • ݐͷܖ •
आۚ • ݐͷߪೖ • ɺೖډ
ͷߪೖ
ͷબఆ • ॅΈ͍ͨҬΛܾΊΔ • ͏ͪͷ߹ʮ୩ࠜઍʯʹݶఆ • ͦͷҬͷͷෆಈ࢈ΛճΔ • Πϯλʔωοτ(جຊతʹ)ʹཱͨ ͳ͍
आۚ
ۚ༥ػ͍ؔΖ͍Ζ • ࢢۜ • ۜ • ৴ୗۜߦ • ωοτۜߦ •
৴ۚ • Ώ͏ͪΐ
ʮࣗ༝ۀʯआ͕͍ۚ͠ • αϥϦʔϚϯ͕͏Β·͍͠Ͱ͢ • ʮࣾձత৴༻ʯॏཁ
ʮࣗ༝ۀʯͲͷΑ͏ʹ ධՁ͞ΕΔ͔ʁ
ʮࣾձత৴༻ʯͷௐࠪ • They use Internet!
ʮࣾձత৴༻ʯ on the net • ஶ࡞ • Rails3ϨγϐϒοΫɺHead First Rails
• ݞॻ͖ • φκͷऔకɺϑΣϩʔۀ • ߨԋ • ͍ΖΜͳࠃͰͬͨΓͯ͠Δ • ΠϯλϏϡʔ • Δͼ·ɺଜ͞Μɺߴڮ৴པ͞Μ
Δͼ·͍͢͝ʂ • ৴ୗۜߦͷ୲ऀ͕Δͼ·ͷ ΠϯλϏϡʔಡΜͰͯϏϏͬͨʂ
2ͭͷੈքଓ͖ͩͬͨʂ • RubyίϛϡχςΟͰͷϓϨθϯε্ => ݱ࣮ࣾձͰͷ৴༻্ • ʑͷίϛοτͷੵΈॏͶ => RubyίϛϡχςΟͰͷϓϨθϯε্
ͭ·Γɺ • RubyͷίʔυΛॻ͚आ͕ۚͰ͖Δʂ
ݐΛݐͯΔ
γεςϜ։ൃʹࣅ͍ͯΔ
๏ͷબఆ • • మࠎ • RC • etc.
మࠎ vs. • ॏްɺେن vs. খճΓɺࣗ༝ • ੩తܕ͚ݴޠ vs.
ಈతݴޠ • JEE vs. LL
ݐங • ࡏདྷ • 2 x 4ɹ • ֤ࣾಠࣗͷ৭ʑ
࡞Γํ͍Ζ͍Ζ • εΫϥον • ϑϧελοΫϑϨʔϜϫʔΫɹ • ࣗࣾFWɺࣗࣾϥΠϒϥϦ
εςʔΫϗϧμʔ͍Ζ͍Ζ • ചΓͷෆಈ࢈ • ॴ༗ऀ • ϋεϝʔΧʔ • ઃܭ࢜ •
σβΠφʔ • େ • ۜߦ
ϓϩϚωʁ
ϓϩϚωʁ • ސ٬ == ϓϩϚω
ϓϩϚωʁ • ސ٬ == ϓϩϚω • ՈΛݐͯΔͱϓϩϚωۀ͕ ܦݧͰ͖·͢ʂ
ઃܭ
ʮιʔείʔυ: ιϑτΣΞͷઃܭਤ Έ͍ͨͳͷʯ
ͱ͍͏͜ͱɺ
ઃܭਤ == ιʔείʔυΈ͍ͨͳͷ • ઃܭ࢜ͷݸੑ͕ग़Δ • ઃܭ࢜ͷ͍͕͍ͬͯ͜Δ • ಡΜͰָ͍ͯ͠ʂ
ઃܭϑΣʔζ • ͏ͪͷ߹ 4ʙ5ϲ݄͙Β͍ (ि2ʙ3ճ͙Β͍ଧͪ߹Θͤ) • ଧͪ߹Θͤฏͷޕલத͕͓͢͢Ί • ઃܭCAD()Ͱ •
ଧͪ߹ΘͤPCͷը໘Λݟͳ͕Β • ຖճଧͪ߹Θͤޙʹ࠷৽൛ͷઃܭਤ͕ࢴͰΒ͑Δ
ઃܭਤ • ຖճຖճຖճຖճɺʮࢴͰʯ
ʮσʔλͰ͘Εʯ • ͑ͬʁ • ͑ͬʁ • ʮͦΜͳ͜ͱΛݴΘΕͨͷॳΊͯͩʯ
ʮσʔλͰ͘Εʯ • ΦʔϓϯͳCADϑΥʔϚοτͱ͔͋Δ ͡ΌΜ • ͦΜͳΦϞνϟʹରԠͯ͠·ͤΜ…
ΥʔλʔϑΥʔϧ vs. ΞδϟΠϧ
ΥʔλʔϑΥʔϧͳͱ͜Ζ • ܖͷ࣌Ͱͯ͢ͷఔ͕ܾΊΒΕͨ ఔද͕Ͱ͖͍ͯΔ • ͪΌΜͱఔදʹԊ࣮͕ͬͯਐΜͰɺ ͪΌΜͱೲظʹϞϊ͕͕͋Δʂ
ΥʔλϑΥʔϧΛࢧ͑Δٕज़ • ྺ࢙ͱܦݧʹཪଧͪ͞Εͨ ਫ਼ͷߴ͍ݟੵΓ • దͳϘϦϡʔϜͷόοϑΝ
ΞδϟΠϧͳͱ͜Ζ • ࣮࣮தʹ݁ߏઃܭόά͕ݟ͔ͭΔ • ࣮͕ਐΉʹ࿈Εͯސ٬͔Β ৽ͨͳཁ͕͋Ε͜Εग़ͯ͘Δ
ΞδϟΠϧͳͱ͜Ζ • ͍͍ͩͨݱͰ͍͍۩߹ʹٵऩͯ͠ Ͳ͏ʹ͔ղܾͯ͘͠ΕΔ • Embrace Changes!
ݐஙۀքਐΜͰ͍Δ • ΥʔλʔϑΥʔϧͬΆ͞ͱΞδϟΠϧ ͬΆ͕͞ͱͯྑ͍όϥϯεͰಉډ
࣮ϑΣʔζ • ओ୲ͷେ1ਓ • جૅɺࠨɺΫϩεɺ֎ߏɺ ͳͲͳͲ৭ʑ
࣮ϑΣʔζ • γεςϜ։ൃͰͨͱ͑ΔͳΒɺ αʔόʔଆͷίʔυ΄΅1ਓͰॻ͍ͯɺ ΫΤϦɺJSɺϚʔΫΞοϓɺetc. ʹपΓΛৼΔΠϝʔδ
ઃܭ͕ݟΕΔޣຯ • ෦ࡐ͕ѲɺબఆͰ͖Δ • ϑϩʔϦϯάɺλΠϧɺนࡐɺυΞɺ૭ɺ Ϋϩεɺ෩࿊ɾΩονϯɾτΠϨɺࣨɺ etc. • ސ٬͕bundleͯ͠Δgemͱ͔ʹ·Ͱ ޱग़͠Ͱ͖ΔΠϝʔδ
(ϓϩάϥϚʔతʹ)໘ന͍෦ࡐ • ਓײηϯαʔ͖র໌ • ిಈεΫϦʔϯ
ਓײηϯαʔ͖র໌ • ηϯαʔ + র໌ ͷ all in one
ྫ͑ɺτΠϨͷ߹ • ୭͔͕τΠϨʹೖΔ • => ηϯαʔ͕ಇ͍ͯిؾ͕͘ • τΠϨ͔Βग़Δ • =>
ిؾ͕ফ͑Δ
ͱ͍͏͜ͱɺ • ηϯαʔͷ͕औΕΕɺτΠϨͷ ۭ͖ঢ়گ͕ϦϞʔτͰѲͰ͖Δʂ
ʮηϯαʔͷAPIͳ͍ͷʁʯ • ʁ • ʮͦΜͳ͜ͱΛݴΘΕͨͷॳΊͯͩʯ • વͦΜͳͷͳ͍
ݱঢ় • ݐஙݱ෦ࡐϝʔΧʔ·Ͱ ϓϩάϥϚʔͷ͕ಧ͍͍ͯͳ͍ • ͍ΖΜͳ෦ࡐ͕APIΛఏڙͯ͘͠ΕΔ Α͏ʹͳͬͨΒͬͱՈ͕ศརʹͳΔ ͣʂ
Ideas • ਓ͕͍ۙͮͨ͜ͱΛݕ͢Δݰؔ • ਓ͕͍ͬͯΔ͜ͱΛݕ͢Δচ֊ஈ • ૭Λ։͚ΔAPI • υΞΛ։͚ΔAPI
Hacking My Home
৭ʑHackͰ͖ΔΞΠςϜ • IRKit • Future Home Controller
IRKit • ֎ઢΛ௨͍ͯ͡Ζ͍ΖϋοΫ͢Δ ָ͍ͭ͠
IRKit • ҙͷ֎ઢϦϞίϯ͔ΒIRKitʹ֎ઢ ৴߸Λૹग़ • => IRKitʹऔΓࠐΜͰJSONͰอଘ • IRKitʹHTTPͰҙͷJSONΛૹΓ͚ͭΔ •
=> IRKit͔Β֎ઢ৴߸ͱͯ͠ૹग़
༻ྫ • ϦϏϯάϧʔϜͷిಈεΫϦʔϯΛɺ ৗ࣌ىಈ͍ͯ͠ΔMacMini͔Β curlίϚϯυͰ։ด • ͜ΕΛcronͰຖே൩ࣗಈ࣮ߦ
Demo
༻ྫ(not implemented yet) • Թηϯαʔͱ࿈ಈͯ͠ɺ ॵ͘ͳͬͨΒউखʹΤΞίϯΛ͚ͭΔ ʗॵ͘ͳ͘ͳͬͨΒউखʹফ͢ • ຖܾ·ͬͨ࣌ؒʹRoombaΛىಈͯ͠ উखʹআ͢Δ
Conclusion • Hack home everyday, and that'll buy you a
house.
Conclusion (2) • ͓͏ͪΛݐͯΑ͏ʂ • Programmableͳ෦ࡐΛબ΅͏ʂ • ຖͷΒ͠ΛϋοΫ͠Α͏ʂ