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
Zephyros
Search
Daniele Polencic
August 28, 2013
Technology
300
1
Share
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
290
Deploying and Scaling Spring Boot Microservices to Amazon EKS
danielepolencic
1
690
From Zero to Forex Trading Bot Hero with Node.js and Typescript
danielepolencic
0
370
Kubernetes Chaos Engineering: Lessons Learned in Networking
danielepolencic
0
230
Deploying and Scaling Spring Boot Microservices to Kubernetes
danielepolencic
0
100
Scaling Machine Learning in the Cloud with Kubernetes
danielepolencic
0
100
From Zero to Forex Trading bot Hero
danielepolencic
0
140
Other Decks in Technology
See All in Technology
Claude Codeですべての日常業務を爆速化しよう!
minorun365
PRO
16
15k
個人AIからチームAIへ:開発における品質と生産性の再設計
moongift
PRO
0
250
形式手法特論:公平性制約の位相的特徴づけ #kernelvm / Kernel VM Study Kansai 12th
ytaka23
1
510
Python開発環境にハーネス適用を検討する
yuuka51
1
550
Spring Boot における AOT Cache 活用テクニックと 起動時間改善事例
ntt_dsol_java
0
160
Kiro CLI v2.0.0がやってきた!
kentapapa
0
200
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
200
OpenID Connectによるサービス間連携
takesection
0
130
Oracle Cloud Infrastructure:2026年5月度サービス・アップデート
oracle4engineer
PRO
1
200
A Harness for Behaviour: how to get AI to generate code that does what we intend, or "TDD in the age of AI"
xpmatteo
0
470
Agentic Design Patterns
glaforge
0
240
イベントストーミングとKiroの仕様駆動開発で実現する要件の認識合わせプロセス
syobochim
7
820
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.8k
WENDY [Excerpt]
tessaabrams
10
37k
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
My Coaching Mixtape
mlcsv
0
130
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
510
New Earth Scene 8
popppiees
3
2.3k
Paper Plane (Part 1)
katiecoart
PRO
0
7.9k
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/