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
| #if 0 | |
| #include <SPI.h> | |
| #include <PN532_SPI.h> | |
| #include "PN532.h" | |
| PN532_SPI pn532spi(SPI, 10); | |
| PN532 nfc(pn532spi); | |
| #elif 1 | |
| #include <PN532_HSU.h> | |
| #include <PN532.h> |
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 blaster = require('pi-blaster.js'), | |
| steps = 5, | |
| MIN = 0, | |
| MAX = 400, | |
| MIN_VAL = 0.01, | |
| MAX_VAL = 0.99; | |
| blaster.setPwm(18,0); | |
| blaster.setPwm(17,1); |
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
| #! /usr/bin/node | |
| var Gpio = require('onoff').Gpio, | |
| request = require('request'), | |
| http = require('http'), | |
| jenkinsUrl = '', | |
| red = new Gpio(17, 'out'), | |
| yellow = new Gpio(18,'out'), | |
| green = new Gpio(27,'out'); |
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
| #! /usr/bin/node | |
| var blaster = require('pi-blaster.js'), | |
| _ = require('lodash'), | |
| fs = require('fs'), | |
| request = require('request'), | |
| responseTimeUrl = ''; | |
| pin = 18, | |
| RIGHT = 0.07, | |
| LEFT = 0.258, |
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
| #helpers.py | |
| from django.contrib.auth import authenticate, login | |
| from django.contrib.auth.models import User | |
| from string import letters, digits | |
| import random | |
| def create_anonymous_user(request, first_name, last_name): | |
| if request and first_name: | |
| # create a random username |
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
| """ | |
| The HOSTMAP variable is a dictionary of lists. The keys represent | |
| roles of a server, the values represent the hostnames of machines that | |
| fill those roles. If you are reading this, you likely know what you're | |
| doing. If you don't know what you're doing, you probably want to put | |
| your hostname into local_dev. Ensure it has a comma at the end, and | |
| the hostname is a string. | |
| You can get your hostname by typing `hostname` into a terminal. | |
| """ |
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
| """ | |
| Here's my sample Django settings for a project I recently did. Visit http://damonjablons.wordpress.com to see the explanation. | |
| """ | |
| import os | |
| import socket | |
| # Set DEBUG = True if on the production server | |
| if socket.gethostname() == 'your.domain.com': | |
| DEBUG = False |
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
| ====================================================== | |
| Setting up Django using Apache/mod_wsgi on Ubuntu 8.10 | |
| ====================================================== | |
| This article will cover setting up Django using Apache/mod_wsgi on Ubuntu | |
| 8.10. The article is targeted at a production environment, but keep in mind | |
| this is a more generalized environment. You may have different requirements, | |
| but this article should at least provide the stepping stones. | |
| The article will use distribution packages where nesscary. As of 8.10 the |