Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Using only CoffeeScript to build an SmartPhone ...
Search
Naoya Ito
October 29, 2011
Technology
10k
19
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using only CoffeeScript to build an SmartPhone Application
Naoya Ito
October 29, 2011
More Decks by Naoya Ito
See All by Naoya Ito
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
4.5k
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
13
4.8k
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
21
8.1k
Functional TypeScript
naoya
19
6.9k
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
77
38k
シェルの履歴とイクンリメンタル検索を使う
naoya
16
6.9k
20230227-engineer-type-talk.pdf
naoya
91
87k
関数型プログラミングと型システムのメンタルモデル
naoya
64
110k
TypeScript による GraphQL バックエンド開発
naoya
29
38k
Other Decks in Technology
See All in Technology
Metadata - Section 1: HTML Basics
mohab1
0
130
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
300
大型犬好きによるPugの紹介
yamanoku
1
160
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
190
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
210
PagerDuty Tech Hub-鳴らすけれど、人は動かない
ezaki
0
180
専門領域のAIをどう評価するか
bengo4com
2
320
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
160
「エーアイ」をバズワードにしないために RPA 導入経験と Kiro 上での Claude モデル利用経験から
kazzpapa3
0
100
夫婦で子育てするための育児標準化
codmoninc
PRO
0
480
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
300
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Six Lessons from altMBA
skipperchong
29
4.5k
Raft: Consensus for Rubyists
vanstee
142
7.8k
Code Review Best Practice
trishagee
74
20k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Embracing the Ebb and Flow
colly
88
5.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
The Curious Case for Waylosing
cassininazir
1
570
Balancing Empowerment & Direction
lara
6
1.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Transcript
CoffeeScript using only to build an SmartPhone Application Naoya Ito
Chrome To iOS
None
Node Titanium Mobile Chrome Extension + +
JavaScript
}); }); }); }); }); });
\(^o^)/
CoffeeScript will save us from the darkside of JavaScript
Node express = require "express" app = module.exports = express.createServer()
app.get "/", (req, res) -> res.render "index", title: "Express"
Titanium Mobile win = Ti.UI.createWindow title: "Chrome To iOS" table
= Ti.UI.createTableView top: 0 data: [] win.add table tabGroup = Ti.UI.createTabGroup tab = Ti.UI.createTab window: win tabGroup.addTab tab tabGroup.open()
Chrome Extension chrome.browserAction.onClicked.addListener (tab) -> chrome.tabs.executeScript null, file: "jquery-1.6.4.min.js", ->
chrome.tabs.executeScript null, file: "content_script.js" chrome.extension.onConnect.addListener (port) -> port.onMessage.addListener (info) -> socket = io.connect 'http://localhost:3000' socket.emit 'fireEvent:openUrl' title: info.title url: info.url image: info.image
To learn more about CoffeeScript
CoffeeScript All your product are belong to
How do they communicate with each other?
None
socket.emit() socket.emit() using socket.io for messaging
Hacking Titanium for enabling Socket.IO WebView proxy technique 0px WebView
left: -100 top: -100 enabling socket.io on HTML <head> socket.emit() Titanium.App.fireEvent() github.com/euforic/ChatSocks/tree/wv-proxy
WebView proxy for Socket.IO socket = {} socket.connect = (win)
-> proxy = Ti.UI.createWebView url: "webview/webview.html" top: -100, left: -100, width: 0 height: 0 win.add proxy # Alias for Titanium functions just for fun socket.emit = (e, params) -> Ti.App.fireEvent e, params socket.on = (e, callback) -> Ti.App.addEventListener e, callback on Titanium App
Open new URL when receiving socket events socket.on 'openUrl', (params)
-> table.prependRow $$.ui.createRow title: params.title || params.url message: 'URLを開く' image: params.image click: -> w = Ti.UI.createWindow() w.add Ti.UI.createWebView url: params.url tab.open w on Titanium App
Using socket.io on Chrome is easy # background.html <html> <head>
<script type="text/javascript" src="http://localhost:3000/socket.io/socket.io.js"></script> <script type="text/javascript" src="background.js"></script> </head> </html> # background.coffee chrome.extension.onConnect.addListener (port) -> port.onMessage.addListener (info) -> socket = io.connect 'http://localhost:3000' socket.emit 'fireEvent:openUrl' ... on Chrome Extension
done!
Node & Titanium Mobile can help you to write SmartPhone
Apps only in CoffeeScript Socket.IO makes work easy!
To learn more about CoffeeScript NO MORE JS HELL!?
Thanks! github/naoya/push-to-ios (Titanium App & Node server) github/naoya/chrome2ios (Chrome Extension)
Design inspired by: zachholman.com/posts/slide-design-for-developers/