This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// `id` is a custom Object and `Actor.getTips()` is an array of `id`s | |
Actor.prototype.hasTipped = function(id) { | |
return new RegExp(id.toString()) | |
.test(this.getTips().toString()); | |
} | |
/* | |
* Specifically, these are MongoDB ObjectIDs from the node-mongodb-native repository. | |
* Actor.getTips().indexOf(id) does not work because `===` returns false on, say, | |
* Actor.getTips()[0] === id. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var key = <my key>, | |
secret = <my secret>, | |
https = require("https"), | |
https_options = { | |
"host": <host>, | |
"path": <path>, | |
"port": <port>, | |
"method": <method>, | |
"headers": { | |
"Authorization": "Basic " + new Buffer(key + ":" + secret, "utf8").toString("base64") |