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 serial | |
import datetime | |
from collections import namedtuple | |
from os import path | |
AirQuality = namedtuple('AirQuality', [ | |
'pm1_standard', # PM 1.0 concentration in μg/m^3, corrected to standard atmophere conditions | |
'pm25_standard', # PM 2.5 concentration in μg/m^3, corrected to standard atmophere conditions | |
'pm10_standard', # PM 10 concentration in μg/m^3, corrected to standard atmophere conditions | |
'pm1_ambient', # PM 10 concentration in μg/m^3, in the current ambient conditions |
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
// Bonfire: Truncate a string | |
// Author: @orelovo | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-truncate-a-string | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function truncate(str, num) { | |
var newStr = ""; | |
if (num >= str.length) | |
newStr = str; | |
else if (num <= 3) |