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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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.4k
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
13
4.7k
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
21
8k
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
OpenSharing について熱く語る〜AI アセットの共有について〜
kameitomohiro
0
210
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
540
行動するAIのためのオントロジー | DevRev — Encraft #26.pdf
dvrv_tknrszk
2
710
顧客の成果創出とプロダクトの成長を 両立するためのFDE
sansantech
PRO
0
670
並行性の問題を防げ!実践トランザクション入門
occhi
0
250
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
1
160
Databricksメトリクスビューはじめてのもくもく会
taka_aki
0
190
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
120
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
130
[2026 Oracle Technical Deep Dive] VMwareワークロードのOCI移行実践ガイド - OCVSでの継続利用からOCIコンピュートへの移行まで (2026年9月17日開催)
oracle4engineer
PRO
0
120
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
490
AI時代だからこそ推したい!Gitコマンド再入門
munakata
0
140
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Ethics towards AI in product and experience design
skipperchong
2
410
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Tell your own story through comics
letsgokoyo
1
1.1k
4 Signs Your Business is Dying
shpigford
187
23k
The Curious Case for Waylosing
cassininazir
1
550
Designing Experiences People Love
moore
143
24k
Raft: Consensus for Rubyists
vanstee
142
7.7k
Making the Leap to Tech Lead
cromwellryan
135
10k
Making Projects Easy
brettharned
120
6.8k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Visualization
eitanlees
153
17k
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/