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
1
270
Zephyros
The OS X window manager for hackers
Daniele Polencic
August 28, 2013
Tweet
Share
More Decks by Daniele Polencic
See All by Daniele Polencic
Zero to Kubernetes — Developer's Gym Singapore
danielepolencic
2
180
Scaling Microservices with Message Queues, Spring Boot and Kubernetes
danielepolencic
3
340
7 tips and tricks on how to make the most of your Kubernetes journey
danielepolencic
3
260
Deploying and Scaling Spring Boot Microservices to Amazon EKS
danielepolencic
1
620
From Zero to Forex Trading Bot Hero with Node.js and Typescript
danielepolencic
0
340
Kubernetes Chaos Engineering: Lessons Learned in Networking
danielepolencic
0
190
Deploying and Scaling Spring Boot Microservices to Kubernetes
danielepolencic
0
68
Scaling Machine Learning in the Cloud with Kubernetes
danielepolencic
0
69
From Zero to Forex Trading bot Hero
danielepolencic
0
110
Other Decks in Technology
See All in Technology
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
310
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
160
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
750
生成AIのガバナンスの全体像と現実解
fnifni
1
190
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
How to Ace a Technical Interview
jacobian
276
23k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Visualization
eitanlees
146
15k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
A Modern Web Designer's Workflow
chriscoyier
693
190k
Producing Creativity
orderedlist
PRO
341
39k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.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/