Skip to content

Instantly share code, notes, and snippets.

View abhishekjairath's full-sized avatar
🍗
work, work, work!

Abhishek Jairath abhishekjairath

🍗
work, work, work!
View GitHub Profile
@abhishekjairath
abhishekjairath / nodobjc-macOS-notification-listener.js
Created March 12, 2017 06:33
Using 'nodobjc' a nodeJS->ObjectveC bridge to listen to distributed notification centre of macOS/OSX.
var $ = require('nodobjc')
$.framework('Foundation')
$.framework('AppKit')
var GetSongs = $.NSObject.extend('Delegate');
GetSongs.addMethod('getMySongs:', 'v@:@', function(self, _cmd, notif){
var userInfo = notif('userInfo')
var keys = userInfo('keyEnumerator');