This file contains hidden or 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
{ | |
"absolute": true, | |
"item": [ | |
{ | |
"text": "", | |
"value": [null, "2024-12-25T00:00:00Z"] | |
} | |
] | |
} |
This file contains hidden or 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 getComputedStyle = require('computed-style'); | |
var fontStyles = ['font-family', 'font-size', 'font-weight', 'font-style']; | |
module.exports = function getFontStyles(domElement) { | |
return { | |
element: domElement, | |
styles: extractFontStyles(domElement) | |
} | |
} |
This file contains hidden or 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
/** | |
* Assume our client object manages all communication with the server and other wonderful stuff | |
*/ | |
var Client = function(socket) { | |
var that = {}; | |
that.ping = function(limit, callback) { | |
var results = []; | |
return _ping(1, results, limit, callback); | |
}; |
This file contains hidden or 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
// What's the best syntax to validate a JSON object? | |
var addr = { NamePrefixText: "Dr.", FirstName: "Lex", LastName: "Luthor", | |
Address: ["5 Upper Ter"], CityName: "SF" }; | |
Validate(addr, Address); // returns true if valid, errors go in an error object like AR | |
// Here are some possibilities: | |
// implicit type | |
var Address = { |
This file contains hidden or 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 Db = require('mongodb').Db, | |
Connection = require('mongodb').Connection, | |
Server = require('mongodb').Server; | |
var db = new Db('mongo-test', new Server("localhost", Connection.DEFAULT_PORT, {}), {native_parser:false}); | |
var context = this; | |
var onConnect = function(err, db) { | |
db.dropDatabase(function() { |