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
class MyModel(Model): | |
start_time = DateTimeField() | |
end_time = DateTimeField() | |
comment = TextField() | |
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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> |
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 formatNumber(number) { | |
number = number.replace(/\D+/g, ''); | |
number = number.replace(/^(1)(\d{0,2})$/, '$1($2'); | |
number = number.replace(/^(1)(\d{3})$/, '$1($2)'); | |
number = number.replace(/^(1)(\d{3})(\d{1,3})$/, '$1($2) $3'); | |
number = number.replace(/^(1)(\d{3})(\d{3})(\d{1,4})$/, '$1($2) $3-$4'); | |
number = number.replace(/^(1)(\d{3})(\d{3})(\d{4})(\d+)$/, '$1($2) $3-$4 x$5'); | |
number = number.replace(/^(1)(.*)/, '$1 $2'); | |
return '+' + number; |
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
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken. |
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
/*************************************************************************************************/ | |
/**** CONFIGURABLE PARAMETERS ****/ | |
/*************************************************************************************************/ | |
/***************************** Motor minthrottle *******************************/ | |
/* Set the minimum throttle command sent to the ESC (Electronic Speed Controller) | |
This is the minimum value that allow motors to run at a idle speed */ | |
//#define MINTHROTTLE 1300 // for Turnigy Plush ESCs 10A | |
//#define MINTHROTTLE 1120 // for Super Simple ESCs 10A | |
//#define MINTHROTTLE 1220 |
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
#include <Wire.h> | |
void i2c_write(int address, byte reg, byte data) { | |
// Send output register address | |
Wire.beginTransmission(address); | |
Wire.write(reg); | |
// Connect to device and send byte | |
Wire.write(data); // low byte | |
Wire.endTransmission(); | |
} |
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
/* | |
AeroQuad v3.0.1 - February 2012 | |
www.AeroQuad.com | |
Copyright (c) 2012 Ted Carancho. All rights reserved. | |
An Open Source Arduino based multicopter. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
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
1 joystick(s) detected. | |
Joystick 0: Saitek ST290 Pro | |
Axis: 0, value: 125 | |
Throttle:0 Roll:125 Pitch:0 Yaw:0 A1:250 | |
Axis: 1, value: 125 | |
Throttle:0 Roll:125 Pitch:125 Yaw:0 A1:250 | |
Axis: 2, value: 125 | |
Throttle:0 Roll:125 Pitch:125 Yaw:125 A1:250 | |
Axis: 3, value: 250 | |
Throttle:0 Roll:125 Pitch:125 Yaw:125 A1:250 |
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
# Hack by @mattwilliamson because DecimalFields are being set as unicode for some reason with the | |
# nonrel or maybe mongo updates | |
def __setattr__(self, name, value): | |
for field in iter(self._meta.fields): | |
if field.attname == name: | |
if field.get_internal_type() == 'DecimalField': | |
value = field.to_python(value) | |
break | |
super(Model, self).__setattr__(name, value) |
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 logging | |
import uuid | |
import re | |
from decimal import Decimal | |
from django.conf import settings | |
from django.db import models | |
from django.db.models import signals | |
from django.dispatch import receiver | |
from django.core.cache import cache |