Skip to content

Instantly share code, notes, and snippets.

View tbbooher's full-sized avatar

Tim Booher tbbooher

View GitHub Profile
import psycopg2
import csv
from dotenv import load_dotenv
import os
from datetime import datetime
# Load environment variables
load_dotenv('../.env')
# Database connection parameters
--
-- Name: orders; Type: TABLE; Schema: public; Owner: tim
--
CREATE TABLE public.orders (
website text,
order_id text,
order_date timestamp without time zone,
purchase_order_number text,
currency text,
\d workout_data_points
Table "public.workout_data_points"
Column | Type | Collation | Nullable | Default
--------------+-----------------------------+-----------+----------+-------------------------------------------------
id | integer | | not null | nextval('workout_data_points_id_seq'::regclass)
workout_id | bigint | | not null |
timestamp | timestamp without time zone | | not null |
elapsed_time | double precision | | |
distance | double precision | | |
speed | double precision | | |
--
-- PostgreSQL database dump
--
-- Dumped from database version 17.0 (Homebrew)
-- Dumped by pg_dump version 17.0 (Homebrew)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;

Rails 7 with Import Maps and CSS Bundling: Assets Not Served from /builds Directory

I'm working on a Rails 7 application where I'm using Import Maps for JavaScript and CSS Bundling via Yarn instead of Sprockets. Despite following the setup instructions, my assets aren't being served correctly from the /builds directory.

Issue:

When loading my homepage, the CSS file is not found, and I get the following error in the browser console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Rails 7 with Import Maps and CSS Bundling: Assets Not Served from /builds Directory

I'm working on a Rails 7 application where I'm using Import Maps for JavaScript and CSS Bundling via Yarn instead of Sprockets. Despite following the setup instructions, my assets aren't being served correctly from the /builds directory.

Issue:

When loading my homepage, the CSS file is not found, and I get the following error in the browser console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
import adsk.core, adsk.fusion, traceback
CIRCLE_DIAMETER = 0.06 # Diameter of the circle in cm (1 mm)
SPACING = 0.4 # Spacing between centers of the circles in cm (5 mm)
OFFSET_DISTANCE = 0.1 # Adjust the offset distance as needed in cm (start with smaller value for testing)
def log_curve_info(curves, ui):
try:
for i, curve in enumerate(curves):
geometry = curve.geometry
import csv
import psycopg2
from dotenv import load_dotenv
import os
from datetime import datetime
from tqdm import tqdm
# Load environment variables from .env file
load_dotenv()
# Load required libraries
library(ggplot2)
library(ggforce)
library(gridExtra)
plot_laser_points <- function() {
plots <- vector("list", length = 9)
circle_radius <- 18 # Fixed circle radius of 18 mm
max_distance_from_center <- 10
@tbbooher
tbbooher / atm.py
Last active November 5, 2023 02:49
class ATM:
def __init__(self):
self._total_twenties = 0
self._total_fives = 0
def deposit_twenty(self, amount):
if amount > 0:
self._total_twenties += amount
return f"Deposited {amount * 20} dollars successfully."
else: