I hereby claim:
- I am nfarah86 on github.
- I am nadinefarah (https://keybase.io/nadinefarah) on keybase.
- I have a public key ASDygiTfau4BCjNq3o9GZFTMUZXUHmWOaong-eCmISGxdgo
To claim this, I am signing this object:
L.mapbox.accessToken = <'secret-token'>; | |
var map = L.mapbox.map('map', 'nfarah86.k5679d8m') | |
.setView([37.77777043035903, -122.4196243286133], 17); | |
var featureLayer = L.mapbox.featureLayer() | |
.loadURL("/contact_map?cache="+(new Date().getTime())) | |
.on('ready', run) | |
.addTo(map); |
from twilio.rest import TwilioRestClient | |
TWILIO_ACCOUNT_SID=os.environ['TWILIO_ACCOUNT_SID'] | |
TWILIO_AUTH_TOKEN=os.environ['TWILIO_AUTH_TOKEN'] | |
TWILIO_NUMBER=os.environ['TWILIO_NUMBER'] | |
def sendMessage(phone_number, message): | |
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) | |
message = client.messages.create( | |
body=message, # Message body, if any |
// omitted code | |
def textMessage(message): | |
sendMessage(os.environ['MY_NUMBER'], message) | |
// omitted code |
class User(Base): | |
""" user using the hardware """ | |
__tablename__ = "users" | |
id = Column(Integer, primary_key = True) | |
first_name = Column(String(20), nullable = False) | |
last_name = Column(String(40), nullable = False) | |
user_name = Column(String(10),nullable = False) | |
email = Column(String (30), nullable = False) | |
password = Column(String(10), nullable = False) |
// omitted code | |
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status | |
{ | |
switch (status) | |
{ | |
case kCLAuthorizationStatusNotDetermined: | |
NSLog(@"Location services authorization status not yet determined."); | |
break; | |
case kCLAuthorizationStatusDenied: | |
NSLog(@"Location services authorization was denied."); |
I hereby claim:
To claim this, I am signing this object:
import UIKit | |
import AVFoundation | |
var audioPlayer: AVAudioPlayer? | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
WITH pm10avg AS ( | |
select AVG(a.pm10.value) avg_pm10, EXTRACT(date from PARSE_TIMESTAMP_ISO8601(a.observation_time.value)) date_pm10 | |
from commons.air_pollution_data_collection a | |
GROUP BY date_pm10 | |
), | |
tempavg as ( | |
SELECT AVG(w.temp.value) avg_weather, EXTRACT(date from PARSE_TIMESTAMP_ISO8601(w.observation_time.value)) date_weather | |
from commons.weather_data_collection w | |
GROUP BY date_weather, aq_date | |
) select pm10avg.avg_pm10, tempavg.avg_weather, pm10avg.date_pm10 |
from settings import * | |
from mongo_config import weather_data_collection, pollution_data_collection | |
from timeloop import Timeloop | |
from datetime import timedelta | |
import requests | |
import json | |
tl = Timeloop() | |
def get_weather_data(): |
@tl.job(interval=timedelta(seconds=120)) | |
def sample_job_every_120s(): | |
weather_response = get_weather_data() | |
air_pollution_data = get_air_pollution_data() | |
insert_to_mongo(weather_response, air_pollution_data) | |
makeRequests() |