Skip to content

Instantly share code, notes, and snippets.

View Fieel's full-sized avatar
🦊
Focusing

Filipe Madureira Fieel

🦊
Focusing
View GitHub Profile
@Fieel
Fieel / OnionADCSensors.py
Created November 19, 2019 09:29
Python script to read data from the ADC Expansion installed on a Onion Omega2 device. Due to space constraints (<6 MB) i had to use the included libraries such as urrlib for POSTing the data (in json format)).
#
# Script che legge le temperature dall'ADC expansion montata
# sull'Onion Omega2.
# Oltre a leggere i dati effettua pure le chiamate HTTP verso il webserver.
# https://docs.onion.io/omega2-docs/adc-expansion.html
# import vari
import math # x calcoli sensori
import json # x jsonificare prima del POST
@Fieel
Fieel / enviroSensors.py
Created November 19, 2019 09:25
Python script to read sensor data from the Enviro+ hat installed in a Raspberry Pi. Using the python libraries to read the raw data, requests library for posting the jsonified data with POST requests and the ST7735 library to update the small LED display whenever a request is done.
#!/usr/bin/python
# Utility di base
import os
import time
import datetime
# Loggare su file
import logging
logging.basicConfig(
@Fieel
Fieel / backupRaspbian.sh
Last active November 19, 2019 09:22
Backup your Raspbian OS in a remote NAS in your LAN, compressed into a .tar.gz archive.
#!/bin/bash
#
# @uthor: Filipe Madureira
# Backups a compressed raspbian system to a remote NAS location.
#
NAS_PATH="//server/share"
MOUNT_PATH="/mnt/remote-nas"
BACKUP_PATH=$MOUNT_PATH"/backups/"
TEMP_PATH="/tmp/backup"
@Fieel
Fieel / ApiTester.js
Last active November 19, 2019 09:21
Formik delegating submit logic to parent component? Gist created to showcase this specific usecase to a friend
// Core
import React, { Component } from "react";
import { connect } from "react-redux";
// Elementi UI
import ErrorMessage from "../../ui/ErrorMessage";
import LoadingSpinner from "../../ui/LoadingSpinner";
import DistanceTestForm from "./DistanceTestForm";
// Utils
@Fieel
Fieel / cloudSettings
Last active August 16, 2019 13:40
VS Settings Sync
{"lastUpload":"2019-08-16T13:40:03.458Z","extensionVersion":"v3.4.1"}