Skip to content

Instantly share code, notes, and snippets.

View Mathews2115's full-sized avatar

Mike Mathews Mathews2115

View GitHub Profile
@Mathews2115
Mathews2115 / remove_subdomain.js
Created August 21, 2019 22:53
handy regex - remove subdomain from full url (not perfect)
/**
* Returns a url without the subdomain. If no subdomain exists, just returns the same url
* @param {string} fullUrl - Example: https://sub.domain.com
* @returns {string} - Url without subdomain - Example: https://domain.com
*/
export const removeSubdomainFrom = function(fullUrl = '') {
// configure host strings
const regex = {
protocol: new RegExp(/http(s)*:\/\//), // gets the http:// OR https:// from url string
subdomain: new RegExp(/^[^.]*\.(?=\w+\.\w+$)/) // gets the http(s)://subdomain portion from url string
@Mathews2115
Mathews2115 / Dash2.md
Last active December 26, 2020 18:34
getting Dash 2.0 working
@Mathews2115
Mathews2115 / auto-dash.md
Last active April 25, 2024 00:47
Automotive dashboard / Gauge cluster on a Raspberry Pi 3 using chomium and node.js

Quick How-To Raspberry Pi 3 Dashboard setup.

This is outdated - refer to this for more updated instructions

WHAT THIS DOESN'T HAVE

  • Code that listens and parses CAN messages. (Though I do use this and it is amazing)

Quick Hardware Review

  • Gauge Cluter/Dashboard
  • A raspberry pi will listen for CANBUS messages and whatever program you use (or make) will reactive to those messages.
@Mathews2115
Mathews2115 / Pis_networking_cheat.md
Last active February 8, 2020 10:53
Pi networking Cheat Sheet

Goals:

  • Eliminate all hotplug/auto networking interfacing on bootup
  • Get 2 RPI3 to talk to each other, one being the Outer Pi and one being the Inner Pi
  • Outer Pi has access to the internet, inner pi can get access to the net through the Outer Pi
  • helpful links
  • (setting up wifi manually, node, etc) https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp

Outer Pi (access to the internet)

  • (disable all AUTO network interfaces…we are manually configuring from here on out)
  • sudo update-rc.d dhcpcd disable