Skip to content

Instantly share code, notes, and snippets.

View cayblood's full-sized avatar

Carl Youngblood cayblood

View GitHub Profile
@cayblood
cayblood / blinds.py
Last active September 13, 2024 14:40
Calculates when to lower exterior solar blinds
#!/home/pi/home-automation/venv/bin/python
import os
import time as mytime
from pprint import pprint
from pyowm import OWM
from pyhubitat import MakerAPI
import astropy.units as u
from astropy.time import Time
from datetime import datetime
from astropy.coordinates import EarthLocation, AltAz
// app/services/auth.server.ts
import { parse } from "cookie";
import { verify } from "jsonwebtoken";
import { findOrCreateUser } from "~/models/user.server";
import { createUserSession, logout } from "~/services/session.server";
import type { HankoAuthInfo } from "~/routes/login";
import { JwksClient } from "jwks-rsa";
export const extractHankoCookie = (request: Request) => {
@cayblood
cayblood / index.tsx
Created March 17, 2023 03:50
remix-forms problem
import React from "react";
import { type ActionFunction, json, type LoaderFunction } from "@remix-run/node";
import { requireUser } from "~/session.server";
import { getUserStatus, syncStripeCustomer } from "~/models/user.server";
import { useLoaderData } from "@remix-run/react";
import Gravatar from "~/components/Gravatar";
import { makeDomainFunction } from "domain-functions";
import { register } from "~/join.server";
import Form from "~/ui/form";
import { z } from "zod";
FROM node:18-bullseye-slim
WORKDIR /myapp
# set for base and all layer that inherit from it
ENV NODE_ENV development
ENV PORT 8888
ENV DATABASE_URL file:./data.db?connection_limit=1
# Install openssl for Prisma

H1 Title

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce sodales ligula sed urna. Aliquam posuere arcu viverra erat. Pellentesque et enim dapibus ante facilisis bibendum. Nam congue dapibus urna. Vestibulum consequat arcu at magna. Nunc faucibus mollis lacus. Nulla tempor luctus tellus. Donec blandit lobortis pede. Vestibulum vel pede ut urna eleifend lacinia. Maecenas ligula nibh, imperdiet at, interdum eget, sagittis eu, enim. Vivamus vel urna. Donec fringilla ullamcorper sem. In risus arcu, pellentesque cursus, faucibus cursus, consequat quis, est. Aliquam id erat. Aliquam arcu. Phasellus vulputate. Integer sem diam, mattis vel, viverra ullamcorper, ultricies quis, nisl. Sed sollicitudin quam ut nisi. Vivamus velit sapien, volutpat eu, faucibus id, nonummy id, urna.

@cayblood
cayblood / blinds.py
Last active June 5, 2022 04:11
Automates operation of our solar blinds using hubitat and MakerAPI
#!/home/pi/home-automation/venv/bin/python
import os
import time as mytime
from pprint import pprint
from pyowm import OWM
from pyhubitat import MakerAPI
import astropy.units as u
from astropy.time import Time
from datetime import datetime
@cayblood
cayblood / requirements.txt
Last active October 27, 2020 01:23
Example of how to sign an API Gateway request using Signature Version 4 IAM-based authentication
requests~=2.24.0
boto3~=1.16.5
aws_requests_auth~=0.4.3
#!/bin/bash
# Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB.
SIZE=${1:-20}
# Get the ID of the environment host Amazon EC2 instance.
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data//instance-id)
# Get the ID of the Amazon EBS volume associated with the instance.
VOLUMEID=$(aws ec2 describe-instances \
///////////////////////////////////////////////////////////////////////////////
// The code in this source file is licensed under the Creative Commons
// Attribution 4.0 International Public License. License text can be found at
// https://creativecommons.org/licenses/by/4.0/deed.ast. It may be shared and
// used freely for any purpose, as long as author attribution is included with
// the source code.
//
// written by Sophia Brandt
// https://www.rockyourcode.com/custom-react-hook-use-aws-amplify-auth/
///////////////////////////////////////////////////////////////////////////////
∴ sudo jamf recon
Password:
Retrieving inventory preferences from https://casper.amazon.com:8443/...
Finding extension attributes...
Locating applications...
Locating hard drive information...
Locating accounts...
Locating printers...
Searching path: /System/Applications
Searching path: /Applications