Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

James D JamesDullaghan

🎯
Focusing
  • Denver, CO
Block or report user

Report or block JamesDullaghan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 = ShopifyAPI::Session.new(current_franchise.shopify_store_url)
scope = ["read_customers"]
uri = URI(permission_url)
View diet.md

Post workout

  • Fructose
  • Dextrose
  • Salt
  • Caffiene

After Workouts

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

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
ReportPresenter
end
@JamesDullaghan
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 = Balanced::Customer.new(
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(File.read("#{Rails.root}/app/assets/images/courses/#{self.slug}-sticker.png"))
src
end
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>
</h3>
<section class="calendar" role="main">
<ul class="day-row">
<li class="day">SUN</li>
View _calendar.scss
.month {
font-family: 'ProximaCond';
background: $primary-color;
font-size: 28px;
letter-spacing: 2px;
text-align: center;
padding: 10px 0;
margin-bottom: 0;
color: #fff;
a {
View calendar_helper.rb
module CalendarHelper
def calendar(date = Date.today, &block)
Calendar.new(self, date, block).table
end
class Calendar < Struct.new(:view, :date, :callback)
HEADER = %w[SUN MON TUE WED THU FRI SAT]
START_DAY = :sunday
delegate :content_tag, to: :view
View purdy.js
var PurdyPercent = function (num, options) {
this.settings = {
hide_decimal_on_whole : true,
decimals : 2,
truncate : false, // (soon)
match_decimals: true, // forces floats to match defined decimal count
rounding : 'default', //default, up, down (soon)
postfix : '%'
};
You can’t perform that action at this time.