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
Zephyros
Search
Daniele Polencic
August 28, 2013
Technology
300
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Zephyros
The OS X window manager for hackers
Daniele Polencic
August 28, 2013
More Decks by Daniele Polencic
See All by Daniele Polencic
Zero to Kubernetes — Developer's Gym Singapore
danielepolencic
2
220
Scaling Microservices with Message Queues, Spring Boot and Kubernetes
danielepolencic
3
380
7 tips and tricks on how to make the most of your Kubernetes journey
danielepolencic
3
310
Deploying and Scaling Spring Boot Microservices to Amazon EKS
danielepolencic
1
700
From Zero to Forex Trading Bot Hero with Node.js and Typescript
danielepolencic
0
390
Kubernetes Chaos Engineering: Lessons Learned in Networking
danielepolencic
0
250
Deploying and Scaling Spring Boot Microservices to Kubernetes
danielepolencic
0
120
Scaling Machine Learning in the Cloud with Kubernetes
danielepolencic
0
120
From Zero to Forex Trading bot Hero
danielepolencic
0
150
Other Decks in Technology
See All in Technology
Claude Code本って、 読む必要あるの?
oikon48
2
470
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
今話題のAI「Jev」って何? 宇宙最速で学ぶ会
minorun365
PRO
26
15k
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
1
160
人間はどの意思決定を手放せるのか
kawasima
15
7.1k
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.9k
開発投資の期待値を上げるプロダクトロードマップづくり ~プロダクトエンジニアが越境して事業を伸ばす~
kekekenta
1
190
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
range over func 2年間の軌跡 Issue #56413 はGoのエコシステムをどう変えたか
ryujicre8ive
0
190
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
160
日経電子版を支えていく Kasane Design System/fec_fukuoka
nikkei_engineer_recruiting
0
1.6k
絵ではじめるKubernetesセキュリティ
aoi1
3
630
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Making the Leap to Tech Lead
cromwellryan
135
10k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
The Cult of Friendly URLs
andyhume
79
7k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
The Curse of the Amulet
leimatthew05
3
14k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Balancing Empowerment & Direction
lara
6
1.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Transcript
Zephyros
The OS X window manager for hackers
DEMO
Adapters
Adapters
None
1 zephyros.bind('t', ['Cmd', 'Shift'], function(err){ 2 zephyros.getFocusedWindow(function(window){ 3 zephyros.getWindowFrame(window.id, function(window){
4 zephyros.setFrame({ 5 id: window.id, 6 frame: {x: 0, y:0, w: 200, h: 300} 7 }); 8 }); 9 }); 10 }); Callback hell
Functional Javascript
3 concepts • Lazy Chains • Promises • Mixins
Lazy Chains 1 new LazyChain([2,1,3]) 2 .invoke('concat', [8,7,6]) 3 .invoke('sort')
4 .invoke('join', ' ') 5 .force(); 6 7 // 1 2 3 6 7 8
Promises 1 asyncCall() 2 .then(function(data1){ 3 // do something... 4
return anotherAsyncCall(); 5 }) 6 .fail(function(err) { 7 // handle any error resulting from any of 8 the above calls 9 }) 10 .done();
Mixins 1 var RectangleClickButton = function(w, h, text, callback) {
2 ... 3 }; 4 5 _.extend(RectangleClickButton.prototype, rectangle); 6 _.extend(RectangleClickButton.prototype, button); 7 _.extend(RectangleClickButton.prototype, onclickControl);
1 var Zephyros = require('node-zephyros'); 2 3 var z =
new Zephyros(); 4 5 z.bind('m', ['Cmd', 'Ctrl']) 6 .windowFocused() 7 .maximize(); 8 API
Window Management Apps
workflow
Workflows #1 1 require('shelljs/global'); 2 var Zephyros = require('node-zephyros'); 3
4 var z = new Zephyros(); 5 6 z.listen('app_launched') 7 .appTitle() 8 .then(function(app){ 9 if( app.title === 'MacVim' ){ 10 exec('mysql.server start'); 11 } 12 });
Workflows #2 1 var Zephyros = require('node-zephyros'); 2 appdb =
fs.createWriteStream('app.db', { 3 flags: 'a'}); 4 5 var z = new Zephyros(); 6 7 z.listen('focus_changed') 8 .appTitle() 9 .then(function(app){ 10 var now = (new Date()).valueOf(); 11 appdb.write(app.title + ',' + now + '\n'); 12 });
1 var Zephyros = require('node-zephyros'), 2 request = require('request'); 3
4 var z = new Zephyros(); 5 6 var cities = ['London', 'Manchester', 'Bath', 'Leeds', 'Liverpool']; 8 z.bind('c', ['Cmd', 'Alt', 'Ctrl']) 9 .chooseFrom({ 10 list: cities, 11 title: 'Cities', 12 lines_tall: 5, 13 chars_wide: 30 14 }) 15 .then(function(index){ 16 request('http://api.openweathermap.org/data/2.5/weather?q=' + cities[index] + 17 ',uk', function(err, res, body){ 19 body = JSON.parse(body); 20 z.api().alert(body.weather[0].description + ' in ' + cities[index]); 22 }); 23 }); Workflows #3
None
and you?
Thanks @danielepolencic http:/ /danielepolencic.github.io/node-zephyros/