Skip to content

Instantly share code, notes, and snippets.

View tayeke's full-sized avatar

Taylor Eke tayeke

View GitHub Profile
@tayeke
tayeke / prepend-files-in-folder.sh
Created March 3, 2021 07:12
Prepend a line to a bunch of CSVs in a folder
#!/bin/bash
cd "path/to/folder"
for file in *.csv; do
test -f "$file" || continue
echo "\"column one\",\"column two\" | cat - "$file" > "temp" && mv "temp" "$file"
done
@tayeke
tayeke / split-activity.awk
Created March 3, 2021 06:51
Splits extremely large CSVs into smaller CSVs by a common date format match using awk
#!/usr/bin/awk -f
#use BEGIN sepecial character to set FS built-in variable
BEGIN {
FS = ","
}
{
# split DD/MM/YYY into an array of values
date_string = substr($5, 2, 10)
file = "exports/activity-"date_string".csv"
@tayeke
tayeke / ph_probe.cpp
Last active December 29, 2020 17:14
Fish Tank Monitoring Arduino App
#include "Arduino.h"
#include "ph_probe.h"
#include "EEPROM.h"
Ph_Probe::Ph_Probe(int pin, int calibrationAddress){
this->pin = pin;
this->calibrationAddress = calibrationAddress;
}