Skip to content

Instantly share code, notes, and snippets.

View tbcooney's full-sized avatar

Taylor Cooney tbcooney

View GitHub Profile
@tbcooney
tbcooney / business_hours.rb
Created August 21, 2019 04:07
Serialization TimeOfDay with Rails and jsonb
#!/usr/bin/env ruby
# Supplies TimeOfDay class that includes parsing, strftime, comparison, and arithmetic
gem 'tod', '~> 2.2'
ActiveRecord::Schema.define do
add_column :businesses, :force => true do |t|
t.jsonb :business_hours
end
end
@tbcooney
tbcooney / migrate_from_g+.md
Last active January 29, 2019 21:13
Migrate From G+

Things We Use Google+ To Do

Case 1

  • When a user creates an account on Universe, they can sign up with Google (via G+ API)
    • user clicks Sign Up With Google, multiverse calls authenticateProvider which creates an OpenID Connect request from a deprecated scope plus/v1/people/me/openIdConnect
    • web sets params via auth_requests_controller.rb using a deprecated scope auth/plus.login
    • user data is fetched from deprecated scope plus/v1/people/me/openIdConnect to populate user info (email, first_name, photo, uid etc.)

Solution

  • Change the scope from deprecated G+ plus.login endpoint to profile
  • Set the user basic profile information with new method

Case 2

@tbcooney
tbcooney / utm-tracking.md
Last active January 24, 2019 21:45
UTM Tracking on Universe

UTM Tracking on Universe

The following overview provides a quick look into data that is captured when a user clicks on a Marketing ad.

Ad Platforms

Events are triggered on a "per channel" basis depending on certain user actions, such as creating an account or purchasing a ticket. Below is an overview of the expected events that should fire on a "per channel" basis. The use cases listed below will highlight the actual behaviour and the discrepency between expected and actual.

Bing

  • CompleteRegistration is fired when a visitor creates an account from Sign Up in the top navigation or Create Event on a landing page
  • Lead is fired when a visitor clicks Sign Up in the top navigation or a User clicks Create Event from a landing page/top navigation

Facebook