Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

John Franco Saraceno OneGneissGuy

🏠
Working from home
View GitHub Profile
@OneGneissGuy
OneGneissGuy / .dockerfile
Created Jun 6, 2022 — forked from icarus44-zer0/.dockerfile
python:3.8.5-slim-buster- multi-stage - non-root - virtualenv
View .dockerfile
FROM python:3.8.5-slim-buster as base
LABEL maintainer="Your Name <Your@Name.com>" \
version="1.0.0"
RUN apt-get update && apt-get install tzdata -y --no-install-recommends
ENV TZ="America/Los_Angeles"
ENV PIP_NO_CACHE_DIR=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
@OneGneissGuy
OneGneissGuy / ads1115_differential.ino
Created Mar 26, 2021
script to try out ads1115 differential
View ads1115_differential.ino
// ads1115_differential.ino
// PURPOSE: read differential
// EDITED BY: JFS 03/26/21
// AUTHOR: Rob.Tillaart
// VERSION: 0.1.1
// test 1
// +signal on AIN0, -signal on AIN1
//EXAMPLE OUTPUT
@OneGneissGuy
OneGneissGuy / stream_arduino.py
Last active Mar 18, 2021
a script to plot streaming arduino data on a com port
View stream_arduino.py
# -*- coding: utf-8 -*-
"""
stream_arduino.py
Stream data from an arduino on a com port
must run %matplotlib
data comes in this format:
12351\r\n
Written by: John Franco Saraceno
@OneGneissGuy
OneGneissGuy / git_update.sh
Created Sep 11, 2020 — forked from cacycleworks/git_update.sh
Simple sh script to automate a git update
View git_update.sh
#!/bin/sh
if [ $# != 2 ]; then
echo "\nchris k's git update automater sh script. Edit to put a bunch of \`git add blah'"
echo "lines in the body then evoke with the branch name and commit description\n"
echo "Usage: $0 <branch_name> <\"Description of update\">\n"
echo " branch_name: the name of the git branch to be created"
echo " Description: Text for: git commit -m \"Description of update\""
echo ""
echo "Example:"
BRANCH="core_override"
@OneGneissGuy
OneGneissGuy / xmas_ornament.ino
Created Jan 5, 2020
arduino script to drive a neopixel christmas ornament
View xmas_ornament.ino
#include <Adafruit_NeoPixel.h>
#define N_PIXELS 19
#define LED_PIN 1
int RandomBlinky = 0;
int Brightness = 120; // Brightness of the pixels is about 60%
int BlinkDelay = 15;
int i = 0;
@OneGneissGuy
OneGneissGuy / description.md
Created Apr 5, 2019 — forked from mangecoeur/description.md
Pandas PostgresSQL support for loading to DB using fast COPY FROM method
View description.md

This small subclass of the Pandas sqlalchemy-based SQL support for reading/storing tables uses the Postgres-specific "COPY FROM" method to insert large amounts of data to the database. It is much faster that using INSERT. To acheive this, the table is created in the normal way using sqlalchemy but no data is inserted. Instead the data is saved to a temporary CSV file (using Pandas' mature CSV support) then read back to Postgres using Psychopg2 support for COPY FROM STDIN.

@OneGneissGuy
OneGneissGuy / read_exo_korv2.py
Last active Jan 3, 2020
script to read an EXO KOR version 2 exported csv file
View read_exo_korv2.py
import pandas as pd
def read_exo_korv2(fname):
df = pd.read_csv(fname, skiprows=9, encoding="UTF-16", parse_dates=[[0,1]],
index_col=0, keep_date_col=False)
return df
datafile = r'./KOR_measurement_file_some_date.csv'
df = read_exo_korv2(datafile)
@OneGneissGuy
OneGneissGuy / exif_gps.py
Created Aug 26, 2018 — forked from snakeye/exif_gps.py
Python: get GPS latitude and longitude coordinates from JPEG EXIF using exifread
View exif_gps.py
import exifread
# based on https://gist.github.com/erans/983821
def _get_if_exist(data, key):
if key in data:
return data[key]
return None
@OneGneissGuy
OneGneissGuy / unzip_r_packages_cli.py
Created Jun 13, 2018
unzip a directory of zip files to a destination directory using the a cli
View unzip_r_packages_cli.py
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 6 11:51:58 2018
unzip a directory of zip files to a destination directory using the a cli
USAGE:
$ python unzip_r_packages_cli.py --indir path_to_zip_files --outdir path_to_destination
@author: jsaracen
"""
@OneGneissGuy
OneGneissGuy / unpack_zips.py
Created Jun 7, 2018
unzip a directory of zip files to a destination directory
View unpack_zips.py
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 6 11:51:58 2018
unzip a directory of zip files to a destination directory
@author: jsaracen
"""
import zipfile
import os