id
stringlengths
34
124
type
stringclasses
4 values
prompt
stringlengths
0
4.95k
response
stringlengths
21
4.89k
source_lang
stringclasses
3 values
target_lang
stringclasses
2 values
repo
stringclasses
75 values
path
stringlengths
10
88
license
stringclasses
1 value
commit
stringlengths
40
40
stars
int64
431
18.7k
source_url
stringlengths
86
176
line_start
int64
1
214
line_end
int64
3
253
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app ...
var app, conf, name, pushservices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; pushservices = new PushServices(); for (name in settings) { conf = settings[name]; if (conf.enabled) { pushservices.addService(name, n...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, conf, name, pushservices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; pushservices = new PushServices(); for (name in settings) { conf = settings[name]; ...
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express() app.configure -> app.use(express.logger(...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:completion
completion
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express() app.configure -> app.use(express.logger(...
app.param 'subscriber_id', (req, res, next, id) -> try req.subscriber = new Subscriber(redis, req.params.subscriber_id) delete req.params.subscriber_id next() catch error res.json error: error.message, 400 app.param 'event_id', (req, res, next, id) -> try req.event =...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
18
47
rs/pushd:pushd.coffee:3:raw_corpus
raw_corpus
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
CoffeeScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
49
98
rs/pushd:pushd.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socke...
var authorize, event_route, ref, ref1, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = []; for (i = 0, len = allow_from.length; i < len; i++)...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
49
98
rs/pushd:pushd.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var authorize, event_route, ref, ref1, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = [];...
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
49
98
rs/pushd:pushd.coffee:3:completion
completion
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
udpApi.checkaccess = authorize('publish') udpApi.on 'message', (msg, rinfo) -> zlib.unzip msg, (err, msg) => if err or not msg.toString() logger.error("UDP Cannot decode message: #{err}") return [method, msg] = msg.toString().split(/\s+/, 2) if not msg then [msg, meth...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
10ac6deafedf9683b158fa51e87e2598d8f18c74
1,157
https://github.com/rs/pushd/blob/10ac6deafedf9683b158fa51e87e2598d8f18c74/pushd.coffee
49
98
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express.createServer() app.configure -> app.use(ex...
CoffeeScript
rs/pushd
pushd.coffee
MIT
8eaa4105d86d7883c8bb42a0f620773d5bf38709
1,157
https://github.com/rs/pushd/blob/8eaa4105d86d7883c8bb42a0f620773d5bf38709/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app ...
var app, conf, name, pushservices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; pushservices = new PushServices(); for (name in settings) { conf = settings[name]; if (conf.enabled) { pushservices.addService(name, n...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
8eaa4105d86d7883c8bb42a0f620773d5bf38709
1,157
https://github.com/rs/pushd/blob/8eaa4105d86d7883c8bb42a0f620773d5bf38709/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, conf, name, pushservices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; pushservices = new PushServices(); for (name in settings) { conf = settings[name]; ...
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express.createServer() app.configure -> app.use(ex...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
8eaa4105d86d7883c8bb42a0f620773d5bf38709
1,157
https://github.com/rs/pushd/blob/8eaa4105d86d7883c8bb42a0f620773d5bf38709/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:completion
completion
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express.createServer() app.configure -> app.use(ex...
app.param 'subscriber_id', (req, res, next, id) -> try req.subscriber = new Subscriber(redis, req.params.subscriber_id) delete req.params.subscriber_id next() catch error res.json error: error.message, 400 app.param 'event_id', (req, res, next, id) -> try req.event =...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
8eaa4105d86d7883c8bb42a0f620773d5bf38709
1,157
https://github.com/rs/pushd/blob/8eaa4105d86d7883c8bb42a0f620773d5bf38709/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express.createServer() app.configure -> app.use(ex...
CoffeeScript
rs/pushd
pushd.coffee
MIT
7ceb220702d1a84dfe235ee2be0329783f1e6f19
1,157
https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app ...
var app, conf, name, pushservices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; pushservices = new PushServices(); for (name in settings) { conf = settings[name]; if (conf.enabled) { pushservices.addService(name, n...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
7ceb220702d1a84dfe235ee2be0329783f1e6f19
1,157
https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, conf, name, pushservices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; pushservices = new PushServices(); for (name in settings) { conf = settings[name]; ...
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express.createServer() app.configure -> app.use(ex...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
7ceb220702d1a84dfe235ee2be0329783f1e6f19
1,157
https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/pushd.coffee
18
47
rs/pushd:pushd.coffee:2:completion
completion
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb pushservices = new PushServices() for name, conf of settings when conf.enabled pushservices.addService(name, new conf.class(conf, logger, tokenResolver)) app = express.createServer() app.configure -> app.use(ex...
app.param 'subscriber_id', (req, res, next, id) -> try req.subscriber = new Subscriber(redis, req.params.subscriber_id) delete req.params.id next() catch error res.json error: error.message, 400 app.param 'event_id', (req, res, next, id) -> try req.event = new Event(...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
7ceb220702d1a84dfe235ee2be0329783f1e6f19
1,157
https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/pushd.coffee
18
47
rs/pushd:pushd.coffee:4:raw_corpus
raw_corpus
options.feedback = (time, apnsSubscriber) -> Subscriber::getInstanceFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") su...
CoffeeScript
rs/pushd
pushd.coffee
MIT
18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a
1,157
https://github.com/rs/pushd/blob/18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a/pushd.coffee
101
107
rs/pushd:pushd.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript options.feedback = (time, apnsSubscriber) -> Subscriber::getInstanceFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistra...
var feedback; options.feedback = function(time, apnsSubscriber) { return Subscriber.prototype.getInstanceFromToken(redis, 'apns', apnsSubscriber.hexToken(), function(subscriber) { return subscriber != null ? subscriber.get(function(info) { if (info.updated < time) { logger.warn(`APNS Automatic unre...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a
1,157
https://github.com/rs/pushd/blob/18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a/pushd.coffee
101
107
rs/pushd:pushd.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var feedback; options.feedback = function(time, apnsSubscriber) { return Subscriber.prototype.getInstanceFromToken(redis, 'apns', apnsSubscriber.hexToken(), function(subscriber) { return subscriber != null ? subscriber.get(function(info) { if (info.upd...
options.feedback = (time, apnsSubscriber) -> Subscriber::getInstanceFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") su...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a
1,157
https://github.com/rs/pushd/blob/18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a/pushd.coffee
101
107
rs/pushd:pushd.coffee:4:completion
completion
options.feedback = (time, apnsSubscriber) -> Subscriber::getInstanceFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) ->
if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") subscriber.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a
1,157
https://github.com/rs/pushd/blob/18d8c93a231e9351a0f6a4e1a10c22cbf5ad717a/pushd.coffee
101
107
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
CoffeeScript
rs/pushd
pushd.coffee
MIT
fc2e2e420c60f4546f3611e8e3851796bdfd54b1
1,157
https://github.com/rs/pushd/blob/fc2e2e420c60f4546f3611e8e3851796bdfd54b1/pushd.coffee
46
89
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socke...
var apns, authorize, event_route, options, ref, ref1, ref2, ref3, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = []; for (i = 0, len = allow...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
fc2e2e420c60f4546f3611e8e3851796bdfd54b1
1,157
https://github.com/rs/pushd/blob/fc2e2e420c60f4546f3611e8e3851796bdfd54b1/pushd.coffee
46
89
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var apns, authorize, event_route, options, ref, ref1, ref2, ref3, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : v...
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
fc2e2e420c60f4546f3611e8e3851796bdfd54b1
1,157
https://github.com/rs/pushd/blob/fc2e2e420c60f4546f3611e8e3851796bdfd54b1/pushd.coffee
46
89
rs/pushd:pushd.coffee:2:completion
completion
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
event_route = /^\/event\/([a-zA-Z0-9:._-]{1,100})$/ udpApi.checkaccess = authorize('publish') udpApi.on 'message', (msg, rinfo) -> zlib.unzip msg, (err, msg) => req = url.parse(msg.toString(), true) # emulate an express route middleware call @checkaccess {socket: remoteAddress: rinfo.address...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
fc2e2e420c60f4546f3611e8e3851796bdfd54b1
1,157
https://github.com/rs/pushd/blob/fc2e2e420c60f4546f3611e8e3851796bdfd54b1/pushd.coffee
46
89
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
CoffeeScript
rs/pushd
pushd.coffee
MIT
023b364baec51251d2e8ec53b5c3ea93e2e6ef28
1,157
https://github.com/rs/pushd/blob/023b364baec51251d2e8ec53b5c3ea93e2e6ef28/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socke...
var apns, authorize, event_route, options, ref, ref1, ref2, ref3, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = []; for (i = 0, len = allow...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
023b364baec51251d2e8ec53b5c3ea93e2e6ef28
1,157
https://github.com/rs/pushd/blob/023b364baec51251d2e8ec53b5c3ea93e2e6ef28/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var apns, authorize, event_route, options, ref, ref1, ref2, ref3, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : v...
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
023b364baec51251d2e8ec53b5c3ea93e2e6ef28
1,157
https://github.com/rs/pushd/blob/023b364baec51251d2e8ec53b5c3ea93e2e6ef28/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:completion
completion
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
udpApi = dgram.createSocket("udp4") event_route = /^\/event\/([a-zA-Z0-9:._-]{1,100})$/ udpApi.checkaccess = authorize('publish') udpApi.on 'message', (msg, rinfo) -> req = url.parse(msg.toString(), true) # emulate an express route middleware call @checkaccess {socket: remoteAddress: rinfo.address}, {json:...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
023b364baec51251d2e8ec53b5c3ea93e2e6ef28
1,157
https://github.com/rs/pushd/blob/023b364baec51251d2e8ec53b5c3ea93e2e6ef28/pushd.coffee
45
87
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return new Subscriber(redis, fields, cb)
CoffeeScript
rs/pushd
pushd.coffee
MIT
4f15a3f4df5a20412f918a985cf814e295c65d3e
1,157
https://github.com/rs/pushd/blob/4f15a3f4df5a20412f918a985cf814e295c65d3e/pushd.coffee
40
43
rs/pushd:pushd.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return new Su...
var createSubscriber; createSubscriber = function(fields, cb) { var service; if (!(service = pushservices.getService(fields.proto))) { throw new Error("Invalid value for `proto'"); } if (!(fields.token = service.validateToken(fields.token))) { throw new Error("Invalid value for `token'"); } return ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
4f15a3f4df5a20412f918a985cf814e295c65d3e
1,157
https://github.com/rs/pushd/blob/4f15a3f4df5a20412f918a985cf814e295c65d3e/pushd.coffee
40
43
rs/pushd:pushd.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var createSubscriber; createSubscriber = function(fields, cb) { var service; if (!(service = pushservices.getService(fields.proto))) { throw new Error("Invalid value for `proto'"); } if (!(fields.token = service.validateToken(fields.token))) { thro...
createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return new Subscriber(redis, fields, cb)
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
4f15a3f4df5a20412f918a985cf814e295c65d3e
1,157
https://github.com/rs/pushd/blob/4f15a3f4df5a20412f918a985cf814e295c65d3e/pushd.coffee
40
43
rs/pushd:pushd.coffee:1:completion
completion
createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto)
throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return new Subscriber(redis, fields, cb)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
4f15a3f4df5a20412f918a985cf814e295c65d3e
1,157
https://github.com/rs/pushd/blob/4f15a3f4df5a20412f918a985cf814e295c65d3e/pushd.coffee
40
43
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
CoffeeScript
rs/pushd
pushd.coffee
MIT
a00ee14233b2798b03dc085cdce78a86076a9be8
1,157
https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socke...
var apns, authorize, event_route, options, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = []; for (i = 0, len = allow_from.length; i < len; ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
a00ee14233b2798b03dc085cdce78a86076a9be8
1,157
https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var apns, authorize, event_route, options, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks =...
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
a00ee14233b2798b03dc085cdce78a86076a9be8
1,157
https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:completion
completion
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
udpApi = dgram.createSocket("udp4") event_route = /^\/event\/([a-zA-Z0-9:._-]{1,100})$/ udpApi.checkaccess = authorize('publish') udpApi.on 'message', (msg, rinfo) -> req = url.parse(msg.toString(), true) # emulate an express route middleware call @checkaccess {socket: remoteAddress: rinfo.address}, {json:...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
a00ee14233b2798b03dc085cdce78a86076a9be8
1,157
https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/pushd.coffee
45
87
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return subscriber.createSubscriber(redis, fields, cb)
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
40
43
rs/pushd:pushd.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return subscr...
var createSubscriber; createSubscriber = function(fields, cb) { var service; if (!(service = pushservices.getService(fields.proto))) { throw new Error("Invalid value for `proto'"); } if (!(fields.token = service.validateToken(fields.token))) { throw new Error("Invalid value for `token'"); } return ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
40
43
rs/pushd:pushd.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var createSubscriber; createSubscriber = function(fields, cb) { var service; if (!(service = pushservices.getService(fields.proto))) { throw new Error("Invalid value for `proto'"); } if (!(fields.token = service.validateToken(fields.token))) { thro...
createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return subscriber.createSubscriber(redis, fields, cb)
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
40
43
rs/pushd:pushd.coffee:1:completion
completion
createSubscriber = (fields, cb) -> throw new Error("Invalid value for `proto'") unless service = pushservices.getService(fields.proto)
throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) return subscriber.createSubscriber(redis, fields, cb)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
40
43
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socke...
var apns, authorize, event_route, options, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = []; for (i = 0, len = allow_from.length; i < len; ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var apns, authorize, event_route, options, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks =...
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
45
87
rs/pushd:pushd.coffee:2:completion
completion
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
udpApi = dgram.createSocket("udp4") event_route = /^\/event\/([a-zA-Z0-9:._-]{1,100})$/ udpApi.checkaccess = authorize('publish') udpApi.on 'message', (msg, rinfo) -> req = url.parse(msg.toString(), true) # emulate an express route middleware call @checkaccess {socket: remoteAddress: rinfo.address}, {json:...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
45
87
rs/pushd:pushd.coffee:3:raw_corpus
raw_corpus
options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") s...
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
88
94
rs/pushd:pushd.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistr...
var feedback; options.feedback = function(time, apnsSubscriber) { return subscriber.getSubscriberFromToken(redis, 'apns', apnsSubscriber.hexToken(), function(subscriber) { return subscriber != null ? subscriber.get(function(info) { if (info.updated < time) { logger.warn(`APNS Automatic unregistrati...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
88
94
rs/pushd:pushd.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var feedback; options.feedback = function(time, apnsSubscriber) { return subscriber.getSubscriberFromToken(redis, 'apns', apnsSubscriber.hexToken(), function(subscriber) { return subscriber != null ? subscriber.get(function(info) { if (info.updated < t...
options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") s...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
88
94
rs/pushd:pushd.coffee:3:completion
completion
options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromToken redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) ->
if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") subscriber.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
417ef78179f801cee98cf039b2bdcaac9096b7f7
1,157
https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/pushd.coffee
88
94
rs/pushd:pushd.coffee:3:raw_corpus
raw_corpus
options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromRegId redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") s...
CoffeeScript
rs/pushd
pushd.coffee
MIT
c5ce15f5a762801097f8d8e2ddf523be510d3a1f
1,157
https://github.com/rs/pushd/blob/c5ce15f5a762801097f8d8e2ddf523be510d3a1f/pushd.coffee
83
89
rs/pushd:pushd.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromRegId redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistr...
var feedback; options.feedback = function(time, apnsSubscriber) { return subscriber.getSubscriberFromRegId(redis, 'apns', apnsSubscriber.hexToken(), function(subscriber) { return subscriber != null ? subscriber.get(function(info) { if (info.updated < time) { logger.warn(`APNS Automatic unregistrati...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
c5ce15f5a762801097f8d8e2ddf523be510d3a1f
1,157
https://github.com/rs/pushd/blob/c5ce15f5a762801097f8d8e2ddf523be510d3a1f/pushd.coffee
83
89
rs/pushd:pushd.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var feedback; options.feedback = function(time, apnsSubscriber) { return subscriber.getSubscriberFromRegId(redis, 'apns', apnsSubscriber.hexToken(), function(subscriber) { return subscriber != null ? subscriber.get(function(info) { if (info.updated < t...
options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromRegId redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") s...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
c5ce15f5a762801097f8d8e2ddf523be510d3a1f
1,157
https://github.com/rs/pushd/blob/c5ce15f5a762801097f8d8e2ddf523be510d3a1f/pushd.coffee
83
89
rs/pushd:pushd.coffee:3:completion
completion
options.feedback = (time, apnsSubscriber) -> subscriber.getSubscriberFromRegId redis, 'apns', apnsSubscriber.hexToken(), (subscriber) -> subscriber?.get (info) ->
if info.updated < time logger.warn("APNS Automatic unregistration for subscriber #{subscriber.id}") subscriber.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
c5ce15f5a762801097f8d8e2ddf523be510d3a1f
1,157
https://github.com/rs/pushd/blob/c5ce15f5a762801097f8d8e2ddf523be510d3a1f/pushd.coffee
83
89
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
CoffeeScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
40
82
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socke...
var apns, authorize, event_route, options, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks = []; for (i = 0, len = allow_from.length; i < len; ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
40
82
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var apns, authorize, event_route, options, udpApi; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1; if (allow_from = (ref = settings.server) != null ? (ref1 = ref.acl) != null ? ref1[realm] : void 0 : void 0) { networks =...
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
40
82
rs/pushd:pushd.coffee:2:completion
completion
authorize = (realm) -> if allow_from = settings.server?.acl?[realm] networks = [] for network in allow_from networks.push new Netmask(network) return (req, res, next) -> if remoteAddr = req.socket and (req.socket.remoteAddress or (req.socket.socket and req.socket.sock...
udpApi = dgram.createSocket("udp4") event_route = /^\/event\/([a-zA-Z0-9:._-]{1,100})$/ udpApi.checkaccess = authorize('publish') udpApi.on 'message', (msg, rinfo) -> req = url.parse(msg.toString(), true) # emulate an express route middleware call @checkaccess {socket: remoteAddress: rinfo.address}, {json:...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
40
82
rs/pushd:pushd.coffee:3:raw_corpus
raw_corpus
options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for device #{device.id}") device.delete() feedback = new ap...
CoffeeScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
83
89
rs/pushd:pushd.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for device #{devic...
var feedback; options.feedback = function(time, apnsDevice) { return device.getDeviceFromRegId(redis, 'apns', apnsDevice.hexToken(), function(device) { return device != null ? device.get(function(info) { if (info.updated < time) { logger.warn(`APNS Automatic unregistration for device ${device.id}`)...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
83
89
rs/pushd:pushd.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var feedback; options.feedback = function(time, apnsDevice) { return device.getDeviceFromRegId(redis, 'apns', apnsDevice.hexToken(), function(device) { return device != null ? device.get(function(info) { if (info.updated < time) { logger.warn(`...
options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for device #{device.id}") device.delete() feedback = new ap...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
83
89
rs/pushd:pushd.coffee:3:completion
completion
options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) ->
if info.updated < time logger.warn("APNS Automatic unregistration for device #{device.id}") device.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
6e013dce036ea96c8e6ba41cb457470c59c5b1df
1,157
https://github.com/rs/pushd/blob/6e013dce036ea96c8e6ba41cb457470c59c5b1df/pushd.coffee
83
89
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' logger = console pushservices = require('./lib/pushservices').getPushServices(settings, logger) app = express.cr...
CoffeeScript
rs/pushd
pushd.coffee
MIT
911bab74c3e3a3fd0974d122f3d3776da8470d9d
1,157
https://github.com/rs/pushd/blob/911bab74c3e3a3fd0974d122f3d3776da8470d9d/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:completion
completion
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' logger = console pushservices = require('./lib/pushservices').getPushServices(settings, logger) app = express.cr...
res.json error: error.message, 400 app.param 'event_id', (req, res, next, id) -> try req.event = event.getEvent(redis, pushservices, req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400 createDevice = (fields, cb) -> device.c...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
911bab74c3e3a3fd0974d122f3d3776da8470d9d
1,157
https://github.com/rs/pushd/blob/911bab74c3e3a3fd0974d122f3d3776da8470d9d/pushd.coffee
1
50
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
try event.getEvent(redis, pushservices, m[1]).publish(req.query) logger.log("UDP #{req.pathname} 204") if settings.server?.access_log catch error logger.error(error.stack) else logger.log("UDP #{req.pathname} 404") if settings.server?.access_log udpApi.bind 80 #...
CoffeeScript
rs/pushd
pushd.coffee
MIT
911bab74c3e3a3fd0974d122f3d3776da8470d9d
1,157
https://github.com/rs/pushd/blob/911bab74c3e3a3fd0974d122f3d3776da8470d9d/pushd.coffee
51
70
rs/pushd:pushd.coffee:2:completion
completion
try event.getEvent(redis, pushservices, m[1]).publish(req.query) logger.log("UDP #{req.pathname} 204") if settings.server?.access_log catch error logger.error(error.stack) else logger.log("UDP #{req.pathname} 404") if settings.server?.access_log udpApi.bind 80
# Handle Apple Feedbacks apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time logger.warn("APNS Automatic unregistration for d...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
911bab74c3e3a3fd0974d122f3d3776da8470d9d
1,157
https://github.com/rs/pushd/blob/911bab74c3e3a3fd0974d122f3d3776da8470d9d/pushd.coffee
51
70
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
CoffeeScript
rs/pushd
pushd.coffee
MIT
b2125908fdf7d7d799985b30c817456d72de149c
1,157
https://github.com/rs/pushd/blob/b2125908fdf7d7d799985b30c817456d72de149c/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServi...
var app, createDevice, device, dgram, event, event_route, express, pushservices, redis, settings, udpApi, url; express = require('express'); dgram = require('dgram'); url = require('url'); redis = require('redis').createClient(); device = require('./lib/device'); event = require('./lib/event'); settings = requir...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
b2125908fdf7d7d799985b30c817456d72de149c
1,157
https://github.com/rs/pushd/blob/b2125908fdf7d7d799985b30c817456d72de149c/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, createDevice, device, dgram, event, event_route, express, pushservices, redis, settings, udpApi, url; express = require('express'); dgram = require('dgram'); url = require('url'); redis = require('redis').createClient(); device = require('./lib/device...
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
b2125908fdf7d7d799985b30c817456d72de149c
1,157
https://github.com/rs/pushd/blob/b2125908fdf7d7d799985b30c817456d72de149c/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:completion
completion
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
app.param 'event_id', (req, res, next, id) -> try req.event = event.getEvent(redis, pushservices, req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400 createDevice = (fields, cb) -> device.createDevice redis, fields, cb requi...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
b2125908fdf7d7d799985b30c817456d72de149c
1,157
https://github.com/rs/pushd/blob/b2125908fdf7d7d799985b30c817456d72de149c/pushd.coffee
1
50
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
event.getEvent(redis, pushservices, m[1]).publish(req.query) catch error # ignore udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> de...
CoffeeScript
rs/pushd
pushd.coffee
MIT
b2125908fdf7d7d799985b30c817456d72de149c
1,157
https://github.com/rs/pushd/blob/b2125908fdf7d7d799985b30c817456d72de149c/pushd.coffee
51
65
rs/pushd:pushd.coffee:2:completion
completion
event.getEvent(redis, pushservices, m[1]).publish(req.query) catch error # ignore udpApi.bind 80 # Handle Apple Feedbacks
apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time device.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
b2125908fdf7d7d799985b30c817456d72de149c
1,157
https://github.com/rs/pushd/blob/b2125908fdf7d7d799985b30c817456d72de149c/pushd.coffee
51
65
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
CoffeeScript
rs/pushd
pushd.coffee
MIT
1023eedc22c4742d8ed1a290cd82b82b5be5cd9d
1,157
https://github.com/rs/pushd/blob/1023eedc22c4742d8ed1a290cd82b82b5be5cd9d/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServi...
var app, createDevice, device, dgram, event, event_route, express, pushservices, redis, settings, udpApi, url; express = require('express'); dgram = require('dgram'); url = require('url'); redis = require('redis').createClient(); device = require('./lib/device'); event = require('./lib/event'); settings = requir...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
1023eedc22c4742d8ed1a290cd82b82b5be5cd9d
1,157
https://github.com/rs/pushd/blob/1023eedc22c4742d8ed1a290cd82b82b5be5cd9d/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, createDevice, device, dgram, event, event_route, express, pushservices, redis, settings, udpApi, url; express = require('express'); dgram = require('dgram'); url = require('url'); redis = require('redis').createClient(); device = require('./lib/device...
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
1023eedc22c4742d8ed1a290cd82b82b5be5cd9d
1,157
https://github.com/rs/pushd/blob/1023eedc22c4742d8ed1a290cd82b82b5be5cd9d/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:completion
completion
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
app.param 'event_id', (req, res, next, id) -> try req.event = event.getEvent(redis, pushservices, req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400 createDevice = (fields, cb) -> device.createDevice redis, fields, cb requi...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
1023eedc22c4742d8ed1a290cd82b82b5be5cd9d
1,157
https://github.com/rs/pushd/blob/1023eedc22c4742d8ed1a290cd82b82b5be5cd9d/pushd.coffee
1
50
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
catch error # ignore udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time ...
CoffeeScript
rs/pushd
pushd.coffee
MIT
1023eedc22c4742d8ed1a290cd82b82b5be5cd9d
1,157
https://github.com/rs/pushd/blob/1023eedc22c4742d8ed1a290cd82b82b5be5cd9d/pushd.coffee
51
64
rs/pushd:pushd.coffee:2:completion
completion
catch error # ignore udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn'
options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time device.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
1023eedc22c4742d8ed1a290cd82b82b5be5cd9d
1,157
https://github.com/rs/pushd/blob/1023eedc22c4742d8ed1a290cd82b82b5be5cd9d/pushd.coffee
51
64
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServi...
var app, device, dgram, event, event_route, express, pushservices, redis, settings, udpApi, url; express = require('express'); dgram = require('dgram'); url = require('url'); redis = require('redis').createClient(); device = require('./lib/device'); event = require('./lib/event'); settings = require('./settings'...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, device, dgram, event, event_route, express, pushservices, redis, settings, udpApi, url; express = require('express'); dgram = require('dgram'); url = require('url'); redis = require('redis').createClient(); device = require('./lib/device'); event = r...
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
1
50
rs/pushd:pushd.coffee:1:completion
completion
express = require 'express' dgram = require 'dgram' url = require 'url' redis = require('redis').createClient() device = require './lib/device' event = require './lib/event' settings = require './settings' pushservices = require('./lib/pushservices').getPushServices(settings) app = express.createServer() app.configu...
app.param 'event_id', (req, res, next, id) -> try req.event = event.getEvent(redis, pushservices, req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400 require('./lib/api').setupRestApi(app) app.listen 80 # UDP Event API udpApi ...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
1
50
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time device.delete() feedback = new a...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
51
61
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.update...
var apns, feedback, options; udpApi.bind(80); // Handle Apple Feedbacks apns = require('apn'); options = settings.apns; options.feedback = function(time, apnsDevice) { return device.getDeviceFromRegId(redis, 'apns', apnsDevice.hexToken(), function(device) { return device != null ? device.get(function(info) { ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
51
61
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var apns, feedback, options; udpApi.bind(80); // Handle Apple Feedbacks apns = require('apn'); options = settings.apns; options.feedback = function(time, apnsDevice) { return device.getDeviceFromRegId(redis, 'apns', apnsDevice.hexToken(), function(device) { ...
udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn' options = settings.apns options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time device.delete() feedback = new a...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
51
61
rs/pushd:pushd.coffee:2:completion
completion
udpApi.bind 80 # Handle Apple Feedbacks apns = require 'apn' options = settings.apns
options.feedback = (time, apnsDevice) -> device.getDeviceFromRegId redis, 'apns', apnsDevice.hexToken(), (device) -> device?.get (info) -> if info.updated < time device.delete() feedback = new apns.Feedback(options)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9bca2082e55e362b913e84d71cde10bbd31f3a5a
1,157
https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/pushd.coffee
51
61
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:2:raw_corpus
raw_corpus
uri = URI(_.compile(options.url, options)) .search searchOptions .toString() return uri getProxyRequest = (options) -> # Format: https://github.com/mikeal/request#requestoptions-callback { method: 'GET' json: false url: getSplunkU...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
42
81
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:2:completion
completion
uri = URI(_.compile(options.url, options)) .search searchOptions .toString() return uri getProxyRequest = (options) -> # Format: https://github.com/mikeal/request#requestoptions-callback { method: 'GET' json: false url: getSplunkU...
q = $q.defer() # Runner Failure errorCallback = (error, status) -> if error == '' && status == 0 # CORS error error = 'Cross-Origin Resource Sharing error with the server.' q.reject error # Successful Result successCallback = (pr...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
42
81
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:raw_corpus
raw_corpus
# Select the final result (non-preview) splunkResult = _.find(results, { preview: false }) || _.first(results) catch e logService.error 'Unexpected response from Splunk: ' + proxyResult.body splunkResult = null if !_.isEmpty results ...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
83
124
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:completion
completion
# Select the final result (non-preview) splunkResult = _.find(results, { preview: false }) || _.first(results) catch e logService.error 'Unexpected response from Splunk: ' + proxyResult.body splunkResult = null if !_.isEmpty results ...
data = _.map splunkResult.rows, (row) -> _.zipObject fields, row # Return the data q.resolve '0': data: data columns: fields # Generate proxy URLs proxyUri = new URI(_.jsExec(options.proxy) || confi...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
83
124
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:2:raw_corpus
raw_corpus
uri = URI(_.compile(options.url, options)) .search searchOptions .toString() return uri getProxyRequest = (options) -> # Format: https://github.com/mikeal/request#requestoptions-callback { method: 'GET' json: false url: getSplunkU...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
6aa99e4a06fb9bdc26f6769552b5d898e5ee1831
1,544
https://github.com/ExpediaGroup/cyclotron/blob/6aa99e4a06fb9bdc26f6769552b5d898e5ee1831/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
42
84
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:2:completion
completion
uri = URI(_.compile(options.url, options)) .search searchOptions .toString() return uri getProxyRequest = (options) -> # Format: https://github.com/mikeal/request#requestoptions-callback { method: 'GET' json: false url: getSplunkU...
# Runner Failure errorCallback = (error, status) -> if error == '' && status == 0 # CORS error error = 'Cross-Origin Resource Sharing error with the server.' q.reject error # Successful Result successCallback = (proxyResult) -> ...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
6aa99e4a06fb9bdc26f6769552b5d898e5ee1831
1,544
https://github.com/ExpediaGroup/cyclotron/blob/6aa99e4a06fb9bdc26f6769552b5d898e5ee1831/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
42
84
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:raw_corpus
raw_corpus
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult errorMessages = _(splunkResult.messages) .filter (message) -> message.type == 'ERROR' .pluck 'text' .value() if !_.isEmpty errorMessages r...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
6aa99e4a06fb9bdc26f6769552b5d898e5ee1831
1,544
https://github.com/ExpediaGroup/cyclotron/blob/6aa99e4a06fb9bdc26f6769552b5d898e5ee1831/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
86
124
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:completion
completion
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult errorMessages = _(splunkResult.messages) .filter (message) -> message.type == 'ERROR' .pluck 'text' .value() if !_.isEmpty errorMessages r...
# Return the data q.resolve '0': data: data columns: fields # Generate proxy URLs proxyUri = new URI(_.jsExec(options.proxy) || configService.restServiceUrl) .protocol '' # Remove protocol to work with either HTTP/HTTPS...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
6aa99e4a06fb9bdc26f6769552b5d898e5ee1831
1,544
https://github.com/ExpediaGroup/cyclotron/blob/6aa99e4a06fb9bdc26f6769552b5d898e5ee1831/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
86
124
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:raw_corpus
raw_corpus
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult errorMessages = _(splunkResult.messages) .filter (message) -> message.type == 'ERROR' .pluck 'text' .value() if !_.isEmpty errorMessages r...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
d9f6710d26e1473dc1dab805685dd5b572fead4a
1,544
https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
86
125
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:completion
completion
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult errorMessages = _(splunkResult.messages) .filter (message) -> message.type == 'ERROR' .pluck 'text' .value() if !_.isEmpty errorMessages r...
q.resolve '0': data: data columns: fields # Do the request, wiring up success/failure handlers proxyUri = (_.jsExec(options.proxy) || configService.restServiceUrl) + '/proxy' # Remove protocol to work with either HTTP or HTTPS pro...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
d9f6710d26e1473dc1dab805685dd5b572fead4a
1,544
https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
86
125
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:raw_corpus
raw_corpus
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult errorMessages = _(splunkResult.messages) .filter (message) -> message.type == 'ERROR' .pluck 'text' .value() if !_.isEmpty errorMessages r...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
aa249eacd2cdb7409ce6c4581e1cedf99c9471b7
1,544
https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
86
122
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:completion
completion
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult errorMessages = _(splunkResult.messages) .filter (message) -> message.type == 'ERROR' .pluck 'text' .value() if !_.isEmpty errorMessages r...
# Return the data q.resolve '0': data: data columns: fields # Do the request, wiring up success/failure handlers proxyUrl = (_.jsExec(options.proxy) || configService.restServiceUrl) + '/proxy' req = $http.post proxyUrl, getPro...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
aa249eacd2cdb7409ce6c4581e1cedf99c9471b7
1,544
https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
86
122
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:2:raw_corpus
raw_corpus
uri = URI(_.compile(options.url, options)) .search searchOptions .toString() console.log uri return uri getProxyRequest = (options) -> # Format: https://github.com/mikeal/request#requestoptions-callback { method: 'GET' json: false ...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
e6c2d6b6ba251383102913db30400f783b64f049
1,544
https://github.com/ExpediaGroup/cyclotron/blob/e6c2d6b6ba251383102913db30400f783b64f049/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
42
80
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:2:completion
completion
uri = URI(_.compile(options.url, options)) .search searchOptions .toString() console.log uri return uri getProxyRequest = (options) -> # Format: https://github.com/mikeal/request#requestoptions-callback { method: 'GET' json: false ...
runner = (options) -> q = $q.defer() # Runner Failure errorCallback = (error, status) -> if error == '' && status == 0 # CORS error error = 'Cross-Origin Resource Sharing error with the server.' q.reject error # Successful Resul...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
e6c2d6b6ba251383102913db30400f783b64f049
1,544
https://github.com/ExpediaGroup/cyclotron/blob/e6c2d6b6ba251383102913db30400f783b64f049/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
42
80
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:raw_corpus
raw_corpus
# Select the final result (non-preview) splunkResult = _.find results, { preview: false } catch e console.log 'Unexpected response from Splunk: ' + proxyResult.body splunkResult = null return errorCallback 'Error retrieving data from Splunk', -1 u...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
e6c2d6b6ba251383102913db30400f783b64f049
1,544
https://github.com/ExpediaGroup/cyclotron/blob/e6c2d6b6ba251383102913db30400f783b64f049/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
82
120
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee:3:completion
completion
# Select the final result (non-preview) splunkResult = _.find results, { preview: false } catch e console.log 'Unexpected response from Splunk: ' + proxyResult.body splunkResult = null return errorCallback 'Error retrieving data from Splunk', -1 u...
# Translate from Splunk JSON_rows format to Cyclotron format if !_.isEmpty(splunkResult) fields = splunkResult.fields data = _.map splunkResult.rows, (row) -> _.zipObject fields, row # Return the data q.resolve '0':...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
MIT
e6c2d6b6ba251383102913db30400f783b64f049
1,544
https://github.com/ExpediaGroup/cyclotron/blob/e6c2d6b6ba251383102913db30400f783b64f049/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
82
120
gterrono/houston:client/db_view.coffee:1:raw_corpus
raw_corpus
# TODO make it server side so filtering can scale filterCollections = (query, collections) -> if query _.filter(collections, (c) -> (c.name).indexOf(query) > -1 ) else collections Template._houston_db_view.helpers collections: -> @collections filtered_collections: -> filterCollections(Hou...
CoffeeScript
gterrono/houston
client/db_view.coffee
MIT
581357048f3577f0487ed598e26eaf063c813183
802
https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/db_view.coffee
1
23