Skip to content

Instantly share code, notes, and snippets.

View heratyian's full-sized avatar
🐢

Ian Heraty heratyian

🐢
View GitHub Profile
@heratyian
heratyian / checkin-functional-spec.md
Last active March 12, 2024 21:00
checkin-functional-spec

Checkin Specification

Checkin sends an email to all members of a team based on the check_in configuration. Members can simply reply to this email and it will create a update record with their reply. As a manager, keeping track of what your direct reports are working on is time consuming. Syncronous meetings are annoying, time consuming, and not effective. Automating checkins via email automates this process and keeps a written record, while being minimally invasive.

User Stories

  • As a lead, I want to create a team, so that I can collaborate with my colleagues on projects.
  • As a lead, I want to invite members to my team by email, so that they can start receiving and responding to check-in prompts.
  • As a member, I want to respond to the morning and evening check-in emails, so that my team can be updated on my daily tasks and accomplishments.
  • As a lead, I want to review all check-in records for my team, so that I can keep track of progress and identify any potential issues early.
  • As a lead, I wa
@heratyian
heratyian / elon-5-steps.md
Last active March 1, 2024 12:55
elon-5-step-algorithm

Elon's 5-Step Engineering Design Process

1. Make requirements less dumb

Your requirements are definitely dumb. It does not matter who gave them to you. It's particularly dangerous if a smart person gave them to because you may not question them enough.

Whatever requirement or constraint you have must come with a name (not a department). That person who is putting forward the requirement/constraint must take responsibility for that requirement.

2. Delete a part or process

Very important. If you are not occasionally adding things back in, you are not deleting enough. The bias tends to be really strongly towards adding a process or step in case we need it. Ruthlessly remove parts/processes and don't hedge your bets.

@heratyian
heratyian / #ChatGPT Streaming.md
Created February 25, 2024 00:45 — forked from alexrudall/#ChatGPT Streaming.md
ChatGPT streaming with ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind!

How to add ChatGPT streaming to your Ruby on Rails 7 app!

This guide will walk you through adding a ChatGPT-like messaging stream to your Ruby on Rails 7 app using ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind. All code included below!

Alt Text

First, add the ruby-openai gem! Needs to be at least version 4. Add Sidekiq too.

@heratyian
heratyian / setup-rails-meta-tags.md
Last active December 11, 2023 17:35
Setup meta tags in your rails app
  1. Add gem "meta-tags" to your gemfile meta-tags

  2. Setup some default meta tags

app/helpers/application_helper.rb

module ApplicationHelper
  def default_meta_tags
    {
 site: "My Awesome App",
@heratyian
heratyian / how-to-setup-background-job.md
Last active December 11, 2023 15:51
Add background service for news.dpi.dev

This is how we created news.dpi.dev, a feed of all DPI trainees blog posts on dev.to. We used sidekiq for background processing, but you could easily use another gem like good_job.

app/controllers/news_controller.rb

class NewsController < ApplicationController
  layout "news"
  skip_before_action :authenticate_user!
  before_action { authorize(:news) }

  def index
@heratyian
heratyian / sdf-final-project-rubric.md
Last active December 4, 2023 21:57
SDF - Final Project Rubric

Final Project Rubric

This is intended to be filled out by staff members of DPI Tech Apprenticeship program. If you do not feel qualified to score a section, feel free to leave it blank.

  • Date/Time
  • Trainee Name
  • Project Name
  • Reviewer Name
@heratyian
heratyian / flash.md
Created November 13, 2023 16:39
flashes

Demo of how to add bootstrap alerts for dismissable flashes

docs

app/views/shared/_flashes.html.erb

<div class="row">
  <div class="col-md-12">
    <% if notice.present? %>
 
@heratyian
heratyian / breadcrumbs.md
Last active November 13, 2023 15:32
Breadcrumbs 🍞

Ruby on Rails implementation of Bootstrap Breadcrumb

app/controllers/posts_controller.rb

class PostsController < ApplicationController
  ...
  def show
    @breadcrumbs = [
      {content: "Posts", href: posts_path},
      {content: @post.to_s, href: post_path(@post)},
@heratyian
heratyian / dev.rake
Created November 8, 2023 21:56
sample-data-task
unless Rails.env.production?
namespace :dev do
desc "Drops, creates, migrates, and adds sample data to database"
task reset: [
:environment,
"db:drop",
"db:create",
"db:migrate",
"dev:sample_data"
]
@heratyian
heratyian / startup-ideas.md
Last active October 24, 2023 14:24
startup-ideas.md
Problem Solution Founder/Market Fit? New insight? (1-5) How big is the idea? (1-5) How acute is the problem? (1-5) Do you want this? (1-5) Competitors Overall Score (?/20) Notes
Truck driver shortage A reverse job board for truck drivers 1 3 3 (no idea) 1 indeed, ziprecruiter, etc. 8
Applying to jobs sucks. Writing resumes takes a lot of time and you don't always get an interview. An AI enabled job/resume coach 3 5 5 3 https://interviewer.ai/, https://www.resumecoach.com/, https://linkedin.com 16