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
290
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
200
Scaling Microservices with Message Queues, Spring Boot and Kubernetes
danielepolencic
3
370
7 tips and tricks on how to make the most of your Kubernetes journey
danielepolencic
3
280
Deploying and Scaling Spring Boot Microservices to Amazon EKS
danielepolencic
1
680
From Zero to Forex Trading Bot Hero with Node.js and Typescript
danielepolencic
0
360
Kubernetes Chaos Engineering: Lessons Learned in Networking
danielepolencic
0
220
Deploying and Scaling Spring Boot Microservices to Kubernetes
danielepolencic
0
92
Scaling Machine Learning in the Cloud with Kubernetes
danielepolencic
0
85
From Zero to Forex Trading bot Hero
danielepolencic
0
130
Other Decks in Technology
See All in Technology
「リリースファースト」の実感を届けるには 〜停滞するチームに変化を起こすアプローチ〜 #RSGT2026
kintotechdev
0
470
AIエージェントを5分で一気におさらい!AIエージェント「構築」元年に備えよう
yakumo
1
130
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
130
人工知能のための哲学塾 ニューロフィロソフィ篇 第零夜 「ニューロフィロソフィとは何か?」
miyayou
0
320
BidiAgent と Nova 2 Sonic から考える音声 AI について
yama3133
2
140
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
2025年の医用画像AI/AI×medical_imaging_in_2025_generated_by_AI
tdys13
0
290
AI との良い付き合い方を僕らは誰も知らない (WSS 2026 静岡版)
asei
1
200
複雑さを受け入れるか、拒むか? - 事業成長とともに育ったモノリスを前に私が考えたこと #RSGT2026
murabayashi
0
940
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
59k
[PR] はじめてのデジタルアイデンティティという本を書きました
ritou
0
740
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
580
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Everyday Curiosity
cassininazir
0
120
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
390
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
220
Designing for humans not robots
tammielis
254
26k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
35
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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/