Skip to content

Instantly share code, notes, and snippets.

View DevGW's full-sized avatar
🔥
building ... things!

JB (DevGW) DevGW

🔥
building ... things!
View GitHub Profile
@DevGW
DevGW / Convert Sticky Notes (outlook) .eml files to markdown files.md
Created November 11, 2023 12:41
Convert Sticky Notes (outlook) .eml files to markdown files.md
import re

def sanitize_filename(filename):
    """
    Sanitize the filename to ensure it's valid and does not contain prohibited characters.
    """
    filename = re.sub(r'[<>:"/\\|?*\']+', '', filename)  # Remove invalid characters
    filename = filename.replace('\n', ' ').replace('\r', '')  # Replace newlines
    return filename.strip()
@DevGW
DevGW / request_logger.rb
Created October 2, 2023 16:41
Add middleware request logging for token testing to rails
#config/request_logger.rb
### NOTE: add the following two lines (uncommented) to your config/application.rb to load the middleware
# require_relative 'request_logger'
# config.middleware.use RequestLogger
class RequestLogger
def initialize(app)
@app = app
end
@DevGW
DevGW / Design Doc Template.md
Created September 7, 2023 19:12
Design Doc Template

Software Design Document (SDD) for [Project Name]

Table of Contents

  1. Introduction 1.1 Purpose 1.2 Scope 1.3 Definitions, Acronyms, and Abbreviations 1.4 References 1.5 Overview
@DevGW
DevGW / USAGE
Created June 28, 2023 20:03 — forked from garrettdimon/USAGE
A basic example of a custom Rails generator with the full guide and explanation available at https://garrettdimon.com/journal/posts/creating-custom-rails-geenrators
Description:
Generates a plain Ruby class with the given NAME
Example:
`bin/rails generate plain Name`
This will create:
app/models/name.rb
test/models/name_test.rb
@DevGW
DevGW / mysql_cheat_sheet.md
Created April 28, 2023 15:51 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@DevGW
DevGW / rails_console_send_email.rb
Last active April 11, 2023 20:05
Rails console send email #hha_ank #rails
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
authentication: 'plain',
enable_starttls_auto: true,
user_name: 'your@gmail.com',
password: 'yourpassword'
}
@DevGW
DevGW / humanize_time.rb
Created March 28, 2023 17:38
Humanize time (seconds) #RoR #ruby
def humanize(secs)
[[60, :seconds], [60, :minutes], [24, :hours], [Float::INFINITY, :days]].map{ |count, name|
if secs > 0
secs, n = secs.divmod(count)
"#{n.to_i} #{name}" unless n.to_i==0
end
}.compact.reverse.join(' ')
end
@DevGW
DevGW / rpi_broadcastify_feed_setup.md
Last active March 26, 2023 15:01
RPI Setup for Broadcastify Feed #rpi #broadcastify #guides
@DevGW
DevGW / OS X Code Signing Pyinstaller.md
Last active April 5, 2023 14:30 — forked from txoof/OS X Code Signing Pyinstaller.md
OSx Code Signing Pyinstaller executable #mac #appdev

Setup

  • Create a developer account with Apple
  • Download and install X-Code from the Apple App Store
  • Open and run X-Code app and install whatever extras it requires
  • Open the preferences pane (cmd+,)
    • click the + in the lower right corner
    • choose Apple ID
    • enter your apple ID and password
@DevGW
DevGW / KT.md
Last active March 21, 2023 15:52
Significant Knowledge Transfer Areas for SD #hha_ank #notes

Knowledge Transfer Areas for SD

The following is a list of key knowledge transfer areas in Self Direction for new developers

  • Tower access and VPN setup and configuration (GCP / Tempus MA)
  • Explanation of Jira and how we use it (what the workflow is)
  • Explanation of how we use Github (PR and Merging workflow)
  • Relevant codebase and associated github repos
    • Frontend UI walkthrough (this should be recorded somewhere or can be done individually)
    • Backend walkthrough and explanation of how clients are loaded over base
  • Getting access to UI client app