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 db = new mongo.Db('mydatabase', new mongo.Server("127.0.0.1", 27017, {})); | |
db.open(function(e, db) { | |
get('/', function() { | |
var $this = this | |
db.collection('some-collection', function(e, col){ | |
col.find({}, {}, function(e, items) { | |
items.each(function(err, item) { | |
sys.puts(sys.inspect(item)) | |
}) |
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 fs = require('fs'), util = require('util'), | |
jsdom = require('jsdom'), http = require('http'); | |
var jQueryHome = '/home/woidda/libs/js/jquery-1.4.2.min.js'; | |
var xmlFileUrl = 'http://www.w3schools.com/xml/plant_catalog.xml'; | |
var host = 'www.w3schools.com'; | |
var client = http.createClient(80, host); |
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
/* Scaled-down Backbone.js demonstration | |
* By Jacob Oscarson (http://twitter.com/jacob414), 2010 | |
* MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */ | |
$(function() { | |
window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); } | |
// Faking a little bit of Backbone.sync functionallity | |
Backbone.sync = function(method, model, succeeded) { | |
ulog('<strong>'+method + ":</strong> " + model.get('label')); | |
if(typeof model.cid != 'undefined') { |
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
.ancestor { | |
shield-name: something; | |
shield-name: something; | |
shield-size: something; | |
shield-fill: something; | |
shield-min-distance: something; | |
shield-spacing: something; | |
shield-spacing: something; | |
shield-line-spacing: something; | |
shield-file: something; |
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
#ifdef _MSC_VER | |
#include <boost/config/compiler/visualc.hpp> | |
#endif | |
#include <boost/property_tree/ptree.hpp> | |
#include <boost/property_tree/json_parser.hpp> | |
#include <boost/foreach.hpp> | |
#include <cassert> | |
#include <exception> | |
#include <iostream> | |
#include <sstream> |
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
function nestCollection(model, attributeName, nestedCollection) { | |
//setup nested references | |
for (var i = 0; i < nestedCollection.length; i++) { | |
model.attributes[attributeName][i] = nestedCollection.at(i).attributes; | |
} | |
//create empty arrays if none | |
nestedCollection.bind('add', function (initiative) { | |
if (!model.get(attributeName)) { | |
model.attributes[attributeName] = []; |
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
<coupling> | |
<P algorithm="serial"> | |
<M name="flow1" type="GROUNDWATER_FLOW" /> | |
<P algorithm="parallel"> | |
<M name="compoundA" type="MASS_TRANSPORT" /> | |
<M name="compoundB" type="MASS_TRANSPORT" /> | |
</P> | |
</P> | |
</coupling> |
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
/* ============================================ | |
* bootstrap-infiniteScroll.js | |
* ============================================ */ | |
!function ($) { | |
'use strict'; | |
var InfiniteScroll = function (el, options) { | |
this.$element = $(el); | |
this.$data = $(el).data(); | |
this.$options = options; |
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
/** | |
* A simple sample of Boost Log | |
*/ | |
#pragma warning(push) | |
#pragma warning(disable:4819) | |
# include <boost/shared_ptr.hpp> | |
# include <boost/date_time/posix_time/posix_time_types.hpp> | |
# include <boost/log/trivial.hpp> | |
# include <boost/log/core.hpp> |
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
The Mosquitto Pub CLI | |
$> mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/thing' -m "Hello from Mosquitto" | |
The Mosquitto Sub CLI | |
$ mosquitto_sub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/+' |
OlderNewer