Skip to content

Instantly share code, notes, and snippets.

View cjlawson02's full-sized avatar

Chris Lawson cjlawson02

View GitHub Profile
@cjlawson02
cjlawson02 / README.md
Last active January 26, 2025 17:22
Repurposing an Android Digital Photo Frame as a Home Assistant Dashboard

Repurposing an Android Digital Photo Frame as a Home Assistant Dashboard

This project is a simple way to repurpose a digital photo frame as a Home Assistant dashboard. The idea is to have a device that is always on and always connected to the Home Assistant server, so you can have a quick look at the status of your home automation system.

Results

Here's a photo of the Nexfoto frame running Fully Kiosk Browser with Home Assistant:

Nexfoto frame running Fully Kiosk Browser with Home Assistant

@cjlawson02
cjlawson02 / README.PolyratingsScript.md
Last active September 26, 2022 23:42
Tampermonkey script for Polyratings

Polyratings Student Center Grease/Tampermonkey Script

Install

Chrome

Firefox

@cjlawson02
cjlawson02 / Remove-WiFi.command
Created September 23, 2021 16:38
macOS Cal Poly Eduroam removal
#!/bin/bash
# Script created by Vince Hunter
# Script updated by Chris Lawson 9/23/21
### This allows the administrator password to be called, and used in the script where sudo is required
### Beware: the inputted password is used in echo commands
### Usage: Use `sudo` without a path to ensure the `sudo` function is called rather than the actual command
# Dialog Title
// the setup routine runs once when you press reset:
void setup() {
//Set pins 8, 9, 10, and 11 (lower bits of Port B) to output
DDRB = 0x3F;
//set the reference voltage to match the scale of the input signal
analogReference(INTERNAL);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
#! /bin/sh
echo "What disk do you want"
echo "to wipe? For example - da1 :"
read disk
echo "OK, in 10 seconds I will destroy all data on $disk!"
echo "Press CTRL+C to abort!"
sleep 10
diskinfo ${disk} | while read disk sectorsize size sectors other
do
# Delete MBR and partition table.
import matplotlib.pyplot as plt
import numpy as np
import time
max_ah = 18 # Maximum Amp Hours of the batteries
dt = 0.01 # Time delta for graph points
res = 0.5 / 1000 # Internal Resistance
tol = 0.01 # Tolerance/Delta between the 2 battery voltages before stopping
# Ask user for state of charge percentage
#include <iostream>
#include <cmath>
using namespace std;
float F16ConvertToF32(uint16_t f16)
{
float f32 = 0;
unsigned sign = (f16 & 0x8000) >> 15; //extract out the sign
unsigned exponent = ((f16 & 0x7C00) >> 10); //extract out the exponent
@cjlawson02
cjlawson02 / Chrisbot.c
Last active December 21, 2018 20:56
VexIQ Triple Play Team 800 Code
#pragma config(Sensor, port2, statusLED, sensorVexIQ_LED)
#pragma config(Motor, motor1, leftMotor, tmotorVexIQ, openLoop, driveLeft)
#pragma config(Motor, motor6, wristMotor, tmotorVexIQ, openLoop, encoder)
#pragma config(Motor, motor7, rightMotor, tmotorVexIQ, openLoop, reversed, driveRight)
#pragma config(Motor, motor9, fourBarMotor, tmotorVexIQ, openLoop, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/**
* IntakeAssembly control modes.
*/
#!/usr/bin/env python3
'''
Greybots Environment Installer
'''
from argparse import ArgumentParser
from inspect import getdoc
from os import chdir, path as ospath
from pathlib import Path
from shutil import rmtree