Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
jlntrt / application_controller.rb
Created May 26, 2020
Server Side Tracking with Matomo and Rails
View application_controller.rb
require 'net/http'
require 'uri'
class ApplicationController < ActionController::Base
after_action :track_request
def track_request
uri = URI('https://<matomo_url>/piwik.php')
View sms_carrier.rb
# The SMScarrier breaks if a message is longer than > 160 characters.
# Every message the SMScarrier sends should also have a suffix: " - message X of Y"
# Instead of using SMScarrier, you can just output the messages to STDOUT
def send_sms_message(text, to, from)
deliver_message_via_carrier(text, to, from)
def deliver_message_via_carrier(text, to, from)
SMScarrier.deliver(text, to, from)