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
// Arduino digital pin serial control | |
// Ben Fasoli | |
// | |
// Takes input strings over a standard serial connection and sets | |
// digital pins high/low. | |
// | |
// Input: | |
// Set pin# to 0,1 (LOW, HIGH) | |
// [pin#].[0,1]\n | |
// 2.1\n |
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
// Air sensor 1 | |
// Ben Fasoli | |
// | |
// Arduino based platform to measure temperature, relative humidity, | |
// pressure, CO2, and PM. | |
// Libraries | |
#include <dht.h> | |
#include <Adafruit_BMP085.h> | |
#include <Adafruit_GPS.h> |
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
#!/usr/bin/python | |
# Ben Fasoli | |
import datetime | |
import RPi.GPIO as GPIO | |
from time import sleep | |
std_pins = [11, 13, 15, 29] | |
qc_pins = [11, 13, 15, 31, 33] | |
all_pins = [11, 13, 15, 29, 31, 33] | |
t = datetime.datetime.utcnow() |
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
#!/usr/bin/python | |
# Ben Fasoli | |
# Maintain an internet connection by monitoring outgoing requests to google's | |
# dns server (8.8.8.8) | |
import os | |
from time import sleep | |
def ping(host = '8.8.8.8'): | |
print('Attempting outgoing connection') |
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
from flask import Flask, request, redirect | |
import requests | |
app = Flask(__name__) | |
@app.route('/fetch_cr1000', methods=['GET']) | |
def fetch_cr1000(): | |
try: | |
ip = request.args.get('ip') | |
table = request.args.get('table') |
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
# Ben Fasoli | |
rm(list = ls()) | |
library(gtrendsR) | |
library(tidyverse) | |
# Get google trend data for searches for skis and ski boots | |
query <- c('skis', 'ski boots') | |
trend <- gtrends(query, geo = 'US', time = 'all') | |
trend_ts <- trend$interest_over_time %>% |
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
library(raster) | |
library(rgdal) | |
# Load footprint from file into rasterBrick object | |
path_to_footprint_nc <- './footprint.nc' | |
footprint <- brick(path_to_footprint_nc) | |
# Sum values per-cell into raster object | |
r_all <- sum(footprint) |
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
library(ggmap) | |
library(tidyverse) | |
# Fetch SLC-centric grayscale Google Map terrain layer | |
basemap <- get_googlemap(center = c(lon = -112.0, lat = 40.6), zoom = 10, | |
scale = 2, maptype = 'terrain', color = 'bw') | |
# Display downloaded map | |
ggmap(basemap) |
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
<form action="https://formspree.io/info@wwtrek.com" method="POST"> | |
<input type="text" name="name" placeholder="Name"> | |
<input type="email" name="_replyto" placeholder="Email Address"> | |
<textarea name="message" placeholder="Message"></textarea> | |
<input type="submit" value="Send"> | |
</form> |
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
# Ben Fasoli | |
# Wait for rslurm::slurm_apply to complete | |
library(rslurm) | |
fun <- function(x) { | |
Sys.sleep(x) | |
return(T) | |
} |
OlderNewer