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
3.6k
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
13
4.5k
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
21
7.9k
Functional TypeScript
naoya
19
6.8k
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
77
38k
シェルの履歴とイクンリメンタル検索を使う
naoya
16
6.8k
20230227-engineer-type-talk.pdf
naoya
91
86k
関数型プログラミングと型システムのメンタルモデル
naoya
63
110k
TypeScript による GraphQL バックエンド開発
naoya
29
37k
Other Decks in Technology
See All in Technology
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
3
780
reFACToring
moznion
0
190
”AIを使う” から ”AIに任せる” へ ─ 開発プロセスを再設計してAIを組織標準にするまで
cyberagentdevelopers
PRO
1
140
探索・可視化・自動化を一本化 Amazon Quickでデータ活用スピードを上げる方法
koheiyoshikawa
0
170
複数プロダクトで進めるAI機能実装 ── 実践から得たリアルな学びとロードマップ実現への挑戦 / AICon2026_yanari
rakus_dev
1
270
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
230
AIエージェントがあれば技術書なんてすぐ書けるでしょ→無理でした
watany
2
270
AIコード生成×サプライチェーン攻撃 — PHPが直面する“二重の信頼問題
shinyasaita
0
450
AI x 開発生産性を取り巻く予算戦略と投資対効果
i35_267
7
2.9k
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
480
ファミコンでPHPを動かす / PHP on the Famicom
tomzoh
2
610
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
260
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
The Cult of Friendly URLs
andyhume
79
7k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
390
Paper Plane
katiecoart
PRO
2
52k
Google's AI Overviews - The New Search
badams
0
1.1k
Everyday Curiosity
cassininazir
0
260
New Earth Scene 8
popppiees
3
2.4k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
RailsConf 2023
tenderlove
30
1.5k
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/