Skip to content

Instantly share code, notes, and snippets.

View MFRWDesign's full-sized avatar

Thomas Sample MFRWDesign

  • Away
View GitHub Profile
@MFRWDesign
MFRWDesign / postgres-install-help.txt
Last active December 10, 2018 16:09
This should be of help for working with different versions of postgres and for working with postgres installed on a non-standard port with Rails.
Postgres commands:
pg_wrapper pgql -U JohnDoe -d postgres ---> login
OR
psql --cluster 10/karma -U JohnDoe -d postgres
\l ---> list databases
\du ---> list roles
\dn ---> list schemas
\dt ---> list tables
\q ---> quit
@MFRWDesign
MFRWDesign / solidus_google_analytics.html.erb
Created January 30, 2018 00:43
Solidus Multi-tenant Google Analytics Tracker
<% if tracker = Spree::Tracker.current(current_store) %>
<script id="solidus_trackers">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<%= tracker.analytics_id %>', 'auto' {'name': '<%= current_store.name %>'});
ga('<%= current_store.name %>.require', 'displayfeatures');
ga('<%= current_store.name %>.send', 'pageview');
<% if @order && order_just_completed?(@order) %>