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
// file: app/models/user.js | |
// Get an instance of mongoose and mongoose Schema | |
var mongoose = require('mongoose'), | |
bcrypt = require('bcrypt'), | |
Schema = mongoose.Schema, | |
SALTINESS = 42; | |
// Create Schema | |
var UserSchema = new Schema({ |
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
import json | |
import tornado.web | |
class JsonHandler(BaseHandler): | |
"""Request handler where requests and responses speak JSON.""" | |
def prepare(self): | |
# Incorporate request JSON into arguments dictionary. | |
if self.request.body: | |
try: |
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 spiDev = "/dev/spidev0.0"; | |
var cePin = 24; | |
var irqPin = 25; | |
var nrf = require('nrf'); | |
var radio = nrf.connect(spiDev, cePin, irqPin); // Connect to the radio | |
radio.channel(0x4c); // Set channel to 76 | |
radio.dataRate('1Mbps') // Set data rate to 1Mbps | |
radio.crcBytes(2) // Set the CRC to 2 | |
radio.autoRetransmit({ |
NewerOlder