Skip to content

Instantly share code, notes, and snippets.


James D JamesDullaghan

View GitHub Profile
JamesDullaghan /
Last active Jun 19, 2021
Difference between mutual ETFs and index funds

Difference between Mutual Funds and ETFs


ETFs are easier to trade and trade at a higher frequency

  • ETF's are securitized stuff like loans packaged or other debt packaged and sold usually with a rating
    • ETFs are baskets of assets traded like securities
  • ETFs are taxed at a different rate than mutual funds and index funds
JamesDullaghan / gist:acd63aefa4383875d5cbdbe965fdfee2
Created Nov 22, 2020 — forked from jvenator/gist:9672772a631c117da151
PDFtk Server Install Workaround for Mac OS X
View gist:acd63aefa4383875d5cbdbe965fdfee2

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge

JamesDullaghan / color_classifier_spec.rb
Created May 18, 2020
Color Classifier spec example for Carrot
View color_classifier_spec.rb
require 'rails_helper'
View shopify_oauth_example.rb
code = request.params[:code]
hmac = request.params[:hmac]
shop = request.params[:shop]
no_values_present = code.nil? && hmac.nil? && shop.nil?
if no_values_present
shopify_session =
scope = ["read_customers"]
uri = URI(permission_url)

Post workout

  • Fructose
  • Dextrose
  • Salt
  • Caffiene

After Workouts

  • Salt depending on the amount of weight that is lost
JamesDullaghan /
Created Jan 10, 2018
Copy task list templates from one team to a group of other teams

To Only remove task templates and recreate

# find source team
src_team = Team.find 836
# find each org
iserve = Organization.find 575
idirect = Organization.find 574

idirect_operable_teams = idirect.teams.where.not(id: 836)
View booking_report_generator.rb
class Booking::ReportGenerator < ReportGenerator
# Presenter class overriding superclass method
# @return [Class]
# @api public
def presenter_class
JamesDullaghan / balanced_ba_cust_issue
Created Jul 28, 2014
Balanced Bank Account Customer issue
View balanced_ba_cust_issue
# Model:
def create_business_customer(data)
customer =
address: {
line1: data[:address],
city: data[:city],
state: data[:state],
postal_code: data[:state]
View base64.rb
def sticker_image_path
src = "data:image/png;base64,"
src += ActiveSupport::Base64.encode64("#{Rails.root}/app/assets/images/courses/#{self.slug}-sticker.png"))
View calendar.html
<div class="row">
<div class="large-12 columns calendar-container">
<h3 class="month">
<a href="/admin/analytics?class=cal-larr&amp;date=2013-11-01">&lt;</a>
December 2013
<a href="/admin/analytics?class=cal-rarr&amp;date=2014-01-01">&gt;</a>
<section class="calendar" role="main">
<ul class="day-row">
<li class="day">SUN</li>