Skip to content

Instantly share code, notes, and snippets.

View dan987's full-sized avatar

Dan M dan987

View GitHub Profile
@dan987
dan987 / common_practice_gitflow.md
Created July 16, 2021 16:50
Common Practice Gitflow

Main Branches

  • Master (Main)
  • dev
  • review
  • staging

From master git checkout dev

@dan987
dan987 / good_practices.md
Last active March 28, 2024 16:43
Common practice guideline: Guidelines and concepts. Reference to common patterns can be found all over the web.

100% of these suggestions are based on recent & relevant real world experience. We have, at least at one point, tried to use these patterns on our own & witnessed how the decision played out over years in production.

General Concepts

module Audited
class Audit
alias_method :after_save, :save
# NOTE: Hack fix checking for changes, still not sure why its triggering 2x
def save(*_args)
unless self.auditable.changed? # better way to get this not to fire 2x?
self.created_at ||= Time.current
conrtl = Audited.store[:current_controller]
if conrtl
@dan987
dan987 / newrelic_instrumenter.rb
Created July 12, 2018 14:46 — forked from nettofarah/newrelic_instrumenter.rb
sample newrelic instrumenter for graphql-ruby
# NewRelic instrumenter for GraphQL-ruby
#
# In your controller:
# ::NewRelic::Agent.add_custom_attributes({
# user_id: @user.try(:id),
# query_string: @query_string,
# query_arguments: @query_variables
# })
#
# @document = self.class.trace_execution_scoped(["GraphQL#parse"]) do
@dan987
dan987 / pr.md
Created August 6, 2014 14:26 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

# We created a folder to house our code for the class
mkdir code
# We changed into that directory
cd code
# We verified git was installed
which git
# After forking on github, we cloned OUR copy
git clone https://github.com/StevenNunez/BEWD_NYC_5.git
# We checked what folders are in our code folder. Cloning creates a folder named after the repository.
ls