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
Using only CoffeeScript to build an SmartPhone ...
Search
Naoya Ito
October 29, 2011
Technology
9.9k
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.3k
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
13
4.7k
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
21
8k
Functional TypeScript
naoya
19
6.9k
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
77
38k
シェルの履歴とイクンリメンタル検索を使う
naoya
16
6.8k
20230227-engineer-type-talk.pdf
naoya
91
87k
関数型プログラミングと型システムのメンタルモデル
naoya
63
110k
TypeScript による GraphQL バックエンド開発
naoya
29
38k
Other Decks in Technology
See All in Technology
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.6k
Kiro Crewしか勝たん!?
miu_crescent
PRO
0
180
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
2
460
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
3
930
Genie Code ワークショップ 応用編 / Genie-Code-Workshop-advanced
databricksjapan
PRO
0
360
Bet AI Day 2026丨AIによって本質に戻るシステムリスク管理
layerx
PRO
0
1.2k
その指示、Bobにしっかり伝わってる?初心者でも即実践できる プロンプト/コンテキスト設計のコツ
muehara
1
200
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
150
振り返りこそエンジニアの本領
negima
0
320
Jetpack Compose で挑む新聞紙面UI ─ 複合ジェスチャー・ポリゴン記事領域・適応的ページ構成という3つの壁/droidkaigi2026
nikkei_engineer_recruiting
0
230
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
260
Autonomous AI Databaseサービス・アップデート(FY27)/ adb-service-update-jp-fy27
oracle4engineer
PRO
0
130
Featured
See All Featured
How to make the Groovebox
asonas
2
2.4k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
520
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Six Lessons from altMBA
skipperchong
29
4.5k
Scaling GitHub
holman
464
140k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
410
Docker and Python
trallard
47
4.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
260
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
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/