Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Sample MFRWDesign

  • Away
View GitHub Profile
@MFRWDesign
MFRWDesign / postgres-install-help.txt
Last active Dec 10, 2018
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.
View postgres-install-help.txt
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 Jan 30, 2018
Solidus Multi-tenant Google Analytics Tracker
View solidus_google_analytics.html.erb
<% 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) %>