Skip to content

Instantly share code, notes, and snippets.

View roberttravispierce's full-sized avatar

Robert Travis Pierce roberttravispierce

View GitHub Profile
@roberttravispierce
roberttravispierce / import_serial_proposals_service.rb
Created September 14, 2022 22:28
Example of a PORO service object
# frozen_string_literal: true
# Invoke: > ImportSerialProposalsService.new.call
class ImportSerialProposalsService
DATA_FILE = File.join(Rails.root, 'db/seeds/serial_proposals/serial_proposals.yml')
LOGFILE = ActiveSupport::Logger.new('log/import_serial_proposals.log')
DEFAULT_NETWORK = "3ABN Parent Network"
def call
serial_proposal_entries.each do |serial_proposal_entry|
@roberttravispierce
roberttravispierce / README.md
Created March 12, 2022 18:14 — forked from IanVaughan/README.md
Trying to understand rbenv gemsets

rbenv gemsets

Versions

$ rbenv
rbenv 0.3.0

$ rbenv gemset
version 0.3.0

rbenv-gemset [command] [options]

@roberttravispierce
roberttravispierce / gist:83a6833e612279b2b938d318a39d73a0
Created March 10, 2022 14:21 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@roberttravispierce
roberttravispierce / rdoc_example.rb
Created February 15, 2022 00:45 — forked from hunj/rdoc_example.rb
Ruby RDoc Example
## Found in: http://blog.firsthand.ca/2010/09/ruby-rdoc-example.html
# * Style guide based on Rails documention
module Namespace #:nodoc: don't document this
# Generic Namespace exception class
class NamespaceError < StandardError
end
# Raised when...
@roberttravispierce
roberttravispierce / import_pnotes_service.rb
Created May 3, 2019 13:31
Rails Service - import_pnotes_service.rb
require 'csv'
require 'nokogiri'
# Invoke: > ImportPnotesService.new.call
class ImportPnotesService
def call
log = ActiveSupport::Logger.new('log/import_pnotes.log')
puts "\n What is the program ID?"
@roberttravispierce
roberttravispierce / db.rake
Created April 27, 2018 12:37 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
...
# ActionMailer Config
config.action_mailer.perform_deliveries = true
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
# MailCatcher gem settings
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
...
%section.page-header.page-header-sm.parallax.parallax-3{:style => "background-image:url(#{asset_path 'background2.jpg'})"}
.overlay.dark-2
.container
%h2.weight-300.text-white.wow.fadeInUp{"data-wow-delay" => "0.8s"} Connect with Silverlane
%section
.container
.row
.col-md-3.col-sm-3
%hr.margin-top-50/
%p